zoukankan      html  css  js  c++  java
  • iOS 高斯模糊 毛玻璃效果

    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));
  • 相关阅读:
    夺命雷公狗---javascript NO:11 事件对象1
    夺命雷公狗---javascript NO:10 解决事件监听兼容性问题和移除事件
    夺命雷公狗---javascript NO:09 事件绑定的种类1
    夺命雷公狗---javascript NO:08 常用的事件
    夺命雷公狗---javascript NO:07 事件编程介绍
    夺命雷公狗---javascript NO:06 数组定义和遍历
    夺命雷公狗---javascript NO:05 js函数中的作用域
    夺命雷公狗---javascript NO:04 js中的函数
    夺命雷公狗---javascript NO:03 流程结构
    夺命雷公狗---javascript NO:02 数据类型和运算符
  • 原文地址:https://www.cnblogs.com/zxs-19920314/p/12809814.html
Copyright © 2011-2022 走看看