您的位置:首页 > 移动开发 > IOS开发

iOS8之后 ,模糊效果简单实现

2016-07-19 14:21 246 查看
iOS8,之后:

storyboard:
直接搜索 控件Visual Effect View with Blur 拉到需要模糊效果视图的上方;

纯代码:
// 创建需要的毛玻璃特效类型
UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

// 毛玻璃view 视图
UIVisualEffectView *effectView = [[UIVisualEffectView alloc] initWithEffect:blurEffect];

//添加到要有毛玻璃特效的控件中
effectView.frame = self.imageV.bounds;
[self.imageV addSubview:effectView];

//设置模糊透明度
effectView.alpha = .8f
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: