iOS-UIKit( UIVisualEffectView.h - -解读)

                            <<UIVisualEffectView.h>>

/*

 iOS 7开始,苹果改变了AppUI风格和动画效果,例如当导航栏出现在屏幕上的效果。尤其是苹果在iOS7中,使用了全新的雾玻璃效果(模糊特

 效)。不仅仅是导航栏,通知中心和控制中心也采用了这个特殊的视觉效果。

 但是苹果并没有在SDK中放入这个特效,程序员不得不使用自己的方法在模拟这个效果,一直到iOS8的出现。

 iOS 8中,SDK中终于正式加入了这个特性,不但让程序员易于上手,而且性能表现也很优秀。苹果将之称为Visual Effects(视觉效果)。

 Visual Effects是一整套的视觉特效,包括了UIBlurEffectUIVibrancyEffect。这两者都是UIVisualEffect的子类,前者允许在你App中动态地创建实时的雾玻璃效果,而后者则允许你在雾玻璃上写字

 */


#import <UIKit/UIKit.h>


NS_ASSUME_NONNULL_BEGIN


 //3种不同的模糊效果:很亮、亮、暗色。

typedef NS_ENUM(NSInteger, UIBlurEffectStyle) {

    UIBlurEffectStyleExtraLight, //偏白色

    UIBlurEffectStyleLight,//模糊

    UIBlurEffectStyleDark //偏黑色

} NS_ENUM_AVAILABLE_IOS(8_0);


//*****************UIVisualEffect*******************

NS_CLASS_AVAILABLE_IOS(8_0)@interface UIVisualEffect :NSObject <NSCopying,NSSecureCoding> @end


//*********UIBlurEffect(继承于UIVisualEffect,允许在你App中动态地创建实时的雾玻璃效果)*******

NS_CLASS_AVAILABLE_IOS(8_0)@interface UIBlurEffect :UIVisualEffect

+ (UIBlurEffect *)effectWithStyle:(UIBlurEffectStyle)style;//模糊效果

@end


//**********UIVibrancyEffect(继承于UIVisualEffect,允许你在雾玻璃上写字”)*********

NS_CLASS_AVAILABLE_IOS(8_0)@interface UIVibrancyEffect : UIVisualEffect

+ (UIVibrancyEffect *)effectForBlurEffect:(UIBlurEffect *)blurEffect;

@end


//*********UIVisualEffectView(UIVisualEffectView控件实现模糊特效)*************


NS_CLASS_AVAILABLE_IOS(8_0)@interface UIVisualEffectView : UIView <NSSecureCoding>

@property (nonatomic,strong, readonly) UIView *contentView;// Do not add subviews directly to UIVisualEffectView, use this view instead.

@property (nonatomic,copy, nullable)UIVisualEffect *effect;

- (instancetype)initWithEffect:(nullableUIVisualEffect *)effect NS_DESIGNATED_INITIALIZER;

- (nullable instancetype)initWithCoder:(NSCoder *)aDecoderNS_DESIGNATED_INITIALIZER;

@end


NS_ASSUME_NONNULL_END

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值