美文网首页
iOS模糊效果

iOS模糊效果

作者: 点点更健康 | 来源:发表于2017-06-05 17:42 被阅读0次

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 – 模糊後加入和模糊對象相比更暗色的色相調整效果

相关文章

网友评论

      本文标题:iOS模糊效果

      本文链接:https://www.haomeiwen.com/subject/tufwfxtx.html