几行代码实现图片的模糊效果
2016-03-22 12:08
316 查看
// 创建一个imageView
UIImageView * backImageView = [[UIImageView alloc]initWithFrame:self.view.bounds];
backImageView.image = [UIImage imageNamed:@"guidance03@3x.jpg"];
[self.view addSubview:backImageView];
//添加模糊效果
UIBlurEffect * blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView * effectView = [[UIVisualEffectView alloc]initWithEffect:blurEffect];
effectView.frame = CGRectMake(0, 64, self.view.frame.size.width, 300);
[backImageView addSubview:effectView];
UIImageView * backImageView = [[UIImageView alloc]initWithFrame:self.view.bounds];
backImageView.image = [UIImage imageNamed:@"guidance03@3x.jpg"];
[self.view addSubview:backImageView];
//添加模糊效果
UIBlurEffect * blurEffect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView * effectView = [[UIVisualEffectView alloc]initWithEffect:blurEffect];
effectView.frame = CGRectMake(0, 64, self.view.frame.size.width, 300);
[backImageView addSubview:effectView];
相关文章推荐
- Lua中的异常处理pcall、xpcall、debug使用实例
- Python 进阶——标准散列机制
- C++单向链表反转
- Java数据库——JDBC 2.0操作
- matplotlib使用
- Django--form保存用户输入内容
- 【图解ASP.NET MVC运行机制理解-简易版】
- 让服务程序进入demon模式的代码
- jta+spring4+hibernate5/jpa2
- numpy用法介绍
- Spring 一二事(8) - annotation 形式的 MVC
- C++ delete[] 是如何知道数组大小的?
- c++四种强制类型转换
- Qt官方开发环境生成的exe发布方式--使用windeployqt
- php设计模式学习系列(五)--单例模式
- Java 泛型数组的问题
- C语言中free函数如何确定释放的空间大小
- 如何使用工具进行线上 PHP 性能追踪及分析?
- Studio初次分享代码到github
- Java项目服务器cpu占用100%解决办法