星空网 > 软件开发 > 操作系统

教你几行代码实现图片的模糊效果

 

一张清楚的图片变的模糊了,也就是所谓的毛玻璃效果,通过查看图层可以发现,它只是在原有的图片上加了一个View,而这个View具有毛玻璃效果,

图层查看如下图所示:

教你几行代码实现图片的模糊效果images/loading.gif' data-original="http://images2015.cnblogs.com/blog/870388/201603/870388-20160303222644096-1518638986.gif" />

 

最终效果图如下图:

教你几行代码实现图片的模糊效果

1 1   // 创建图片2 2   UIImageView *imgView = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];3 3   imgView.image = [UIImage imageNamed:@"1"];4 4   [self.view addSubview:imgView];5 5   //添加模糊效果6 6   UIBlurEffect *blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];7 7   UIVisualEffectView *effectView = [[UIVisualEffectView alloc]initWithEffect:blurEffect];8 8   effectView.frame = [UIScreen mainScreen].bounds;9 9   [imgView addSubview:effectView];

 




原标题:教你几行代码实现图片的模糊效果

关键词:图片

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

跨境巴士:https://www.goluckyvip.com/tag/35314.html
跨境白武士James:https://www.goluckyvip.com/tag/35315.html
跨境百科:https://www.goluckyvip.com/tag/35316.html
跨境保健品电商:https://www.goluckyvip.com/tag/35317.html
跨境保险张慢慢:https://www.goluckyvip.com/tag/35318.html
跨境堡:https://www.goluckyvip.com/tag/35319.html
在古巴做游轮 古巴旅游项目:https://www.vstour.cn/a/363194.html
西藏旅游攻略自驾游需要多少天 去西藏旅游自驾游要多久时间:https://www.vstour.cn/a/363195.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流