码迷,mamicode.com
首页 > 移动开发 > 详细

iOS 高斯模糊 毛玻璃效果

时间:2020-04-30 17:21:45      阅读:826      评论:0      收藏:0      [点我收藏+]

标签:tomat   nbsp   effect   int   isp   效果   min   ica   extra   

1. 代码实现

1 UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
2 UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
3 effectview.frame =self.view.frame;
4 [self.view addSubview:effectview];

 

2.毛玻璃样式枚举

UIBlurEffect *blur = [UIBlurEffect effectWithStyle:毛玻璃样式];
 1 typedef NS_ENUM(NSInteger, UIBlurEffectStyle) {
 2     /* Traditional blur styles.
 3      */
 4     UIBlurEffectStyleExtraLight,
 5     UIBlurEffectStyleLight,
 6     UIBlurEffectStyleDark,
 7     UIBlurEffectStyleExtraDark API_AVAILABLE(tvos(10.0)) API_UNAVAILABLE(ios) API_UNAVAILABLE(watchos),
 8 
 9     /* Styles which automatically show one of the traditional blur styles,
10      * depending on the user interface style.
11      *
12      * Regular displays either Light or Dark.
13      */
14     UIBlurEffectStyleRegular API_AVAILABLE(ios(10.0)),
15     /* Prominent displays either ExtraLight, Dark (on iOS), or ExtraDark (on tvOS).
16      */
17     UIBlurEffectStyleProminent API_AVAILABLE(ios(10.0)),
18 
19     /*
20      * Blur styles available in iOS 13.
21      *
22      * Styles which automatically adapt to the user interface style:
23      */
24     UIBlurEffectStyleSystemUltraThinMaterial        API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
25     UIBlurEffectStyleSystemThinMaterial             API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
26     UIBlurEffectStyleSystemMaterial                 API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
27     UIBlurEffectStyleSystemThickMaterial            API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
28     UIBlurEffectStyleSystemChromeMaterial           API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
29 
30     /* And always-light and always-dark versions:
31      */
32     UIBlurEffectStyleSystemUltraThinMaterialLight   API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
33     UIBlurEffectStyleSystemThinMaterialLight        API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
34     UIBlurEffectStyleSystemMaterialLight            API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
35     UIBlurEffectStyleSystemThickMaterialLight       API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
36     UIBlurEffectStyleSystemChromeMaterialLight      API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
37 
38     UIBlurEffectStyleSystemUltraThinMaterialDark    API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
39     UIBlurEffectStyleSystemThinMaterialDark         API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
40     UIBlurEffectStyleSystemMaterialDark             API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
41     UIBlurEffectStyleSystemThickMaterialDark        API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
42     UIBlurEffectStyleSystemChromeMaterialDark       API_AVAILABLE(ios(13.0)) API_UNAVAILABLE(tvos, watchos),
43 
44 } API_AVAILABLE(ios(8.0));

 

iOS 高斯模糊 毛玻璃效果

标签:tomat   nbsp   effect   int   isp   效果   min   ica   extra   

原文地址:https://www.cnblogs.com/zxs-19920314/p/12809814.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!