iOS 模糊效果实现方式

4种方式实现iOS模糊效果

http://www.jianshu.com/p/70d3af876909

//透明模糊

  • (UIImage *)applyLightEffect;

  • 白色模糊

  • (UIImage *)applyExtraLightEffect;

  • 黑色模糊

  • (UIImage *)applyDarkEffect;

  • 指定颜色模糊

  • (UIImage *)applyTintEffectWithColor:(UIColor *)tintColor;

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16

    /**
    * 默认透明模糊 不用这个方法了
    */
    - (void)refreshBlurViewForNewImage
    {
    // 得到截屏
    UIImage *screenShot = [self screenShotOfView:self];
    /**
    * 模糊的速度 模糊层的最终透明度 --默认
    */
    // screenShot = [screenShot applyBlurWithRadius:30 tintColor:[UIColor colorWithWhite:0.6 alpha:0.2] saturationDeltaFactor:1.0 maskImage:nil];
    screenShot = [screenShot applyLightEffect];
    // 虚化层设置图片
    self.blurryImgView.image = screenShot;
    }
文章作者: kyren
文章链接: http://huluo666.github.io/2016/08/15/iOS实现模糊效果/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 Kyren's Blog