美文网首页
添加模糊效果

添加模糊效果

作者: HaibaraAii | 来源:发表于2015-12-22 16:44 被阅读35次

共4步,

  1. 创建一个UIBlurEffect Efffect效果有extralight, light, dark三种
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleExtraLight];
  1. 创建一个UIVisualEffectView
UIVisualEffectView *blurEffectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];
  1. 设置blurEffectView的frame
blurEffectView.frame = self.view.bounds;
  1. 添加blurEffectView到目标View上面去
[self.tableView.backgroundView addSubview:blurEffectView];

相关文章

网友评论

      本文标题:添加模糊效果

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