iOS8自带模糊效果

2021-10-29 14:00:47 浏览数 (1)

代码语言:javascript复制
typedef NS_ENUM(NSInteger, UIBlurEffectStyle) {

    UIBlurEffectStyleExtraLight,

    UIBlurEffectStyleLight,

    UIBlurEffectStyleDark

} NS_ENUM_AVAILABLE_IOS(8_0);

UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];  
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];  
blurEffectView.frame = self.imageView.bounds;  
[self.imageView insertSubview:blurEffectView atIndex:0];  
 
</pre> 

0 人点赞