iOS模糊效果

iOS 7 以前

  1. 使用 CoreImage
  2. 使用 GPUImage
  3. 使用 vImage

iOS 8 及以后

  1. 使用UIVisualEffect以及UIVisualEffectView
UIVisualEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 
UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
visualEffectView.frame = imageView.bounds
[imageView addSubview:visualEffectView];

UIBlurEffect 的种类

  • UIBlurEffectStyleExtraLight – 模糊後加入和模糊對象相比更明亮的色相( Hue )調整效果
  • UIBlurEffectStyleLight – 模糊後加入和模糊對象相等的色相調整效果
  • UIBlurEffectStyleDark – 模糊後加入和模糊對象相比更暗色的色相調整效果
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容