实现毛玻璃模糊效果/DRNRealTimeBlur
2016-07-11 14:26
459 查看
四种方法:1.美工出图
2.coreImage框架,高斯效果
3.ToolBar,覆盖在view上边
4.第三方框架DRNRealTimeBlur,继承封装好的view(轻量级,建议使用这种). 或第三方框架:LBBlurredImage
步骤:
1.github下载框架
2.拖入程序
3.编写代码:
4.实现毛玻璃效果前后:
bug:如果在stroyBoard中出现毛玻璃图层无故遮挡其他图层问题,可先将毛玻璃图层调至最底层,在调回正确位置.即可修复.
2.coreImage框架,高斯效果
3.ToolBar,覆盖在view上边
//1.添加图片 self.imageView.image = [UIImage imageNamed:@"dog"]; //2.创建toolbar图层 UIToolbar *toolbar = [[UIToolbar alloc] initWithFrame:CGRectMake(0, 0,self.imageView.frame.size.width,self.imageView.frame.size.height)]; //3.设置toolbar模糊背景色调(默认白色) toolbar.barStyle = UIBarStyleDefault; //4.把图层覆盖到view上 [self.imageView addSubview:toolbar];
4.第三方框架DRNRealTimeBlur,继承封装好的view(轻量级,建议使用这种). 或第三方框架:LBBlurredImage
步骤:
1.github下载框架
2.拖入程序
3.编写代码:
#import "ViewController.h" #import "DRNRealTimeBlurView.h" @interface ViewController () @end @implementation ViewController - (void)viewDidLoad { [super viewDidLoad]; //1.随便创建一个imageView UIImage *image = [UIImage imageNamed:@"dog"]; UIImageView *imageView = [[UIImageView alloc]initWithImage:image]; //2.创建毛玻璃View DRNRealTimeBlurView *blurView = [[DRNRealTimeBlurView alloc]initWithFrame:imageView.frame]; //3.覆盖在imageview上. [self.view addSubview: imageView]; [self.view addSubview:blurView]; }
4.实现毛玻璃效果前后:
bug:如果在stroyBoard中出现毛玻璃图层无故遮挡其他图层问题,可先将毛玻璃图层调至最底层,在调回正确位置.即可修复.
相关文章推荐
- 邦德_纪中1236_最大权匹配_状压dp
- maven 打包时mapper.xml打不进去问题
- mysql 行转列
- PHP编程效率的21个要点
- effective java-类和接口
- java开发中JDBC连接数据库
- 足球控(1) PagerSlidingTabStrip用法及解析
- PHP-flush函数
- 常用Linux命令收集
- 使用viewPager实现引导页
- [HDU 5372] Segment Game (树状数组)
- android studio Git版本管理工具的使用
- Image Stride(内存图像行跨度)
- HTML5音频
- IOS对于多线程NSOperation方式的一些发现.
- Java并发编程:阻塞队列
- How to handle big repositories with git
- opencv-计算原始LBP特征
- java多态的实现(一)
- {小结}2016.07.11【初中部 NOIP提高组 】模拟赛C