iOS 8 模糊视图(毛玻璃效果)的简单实现UIVisualEffectView
2024-08-31 05:08:35
在须要模糊的UIView上。加入一个UIVisualEffectView对象就可以。
效果例如以下图:
代码例如以下:
UIImageView *imageview = [[UIImageViewalloc]
init];
imageview.,,
, );
imageview.image = [UIImageimageNamed:@"2"];
imageview.contentMode =UIViewContentModeScaleAspectFit;
imageview.userInteractionEnabled =YES;
[self.viewaddSubview:imageview];
UIBlurEffect *blur = [UIBlurEffecteffectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectview = [[UIVisualEffectViewalloc]
initWithEffect:blur];
effectview.,,
imageview.,);
[imageviewaddSubview:effectview];
UIButton *btn = [UIButtonbuttonWithType:UIButtonTypeSystem];
btn.,,
, );
[btn setTitle:@"btn"forState:UIControlStateNormal];
[effectview.contentViewaddSubview:btn];
iOS开发交流群361513739
最新文章
- 文件IO函数和标准IO库的区别
- ThinkPHP3.2.3 跨域访问
- Crystal Reports拉报表报错:Error detected by database DLL
- CRC-16/XMODE X16+X12+X5+1 C#、C和java环境下实现
- XSS转码 &;amp;&;amp; struts2 property标签的bug
- 下载和编译 Open XML SDK
- 《Mathematical Olympiad——组合数学》——操作和游戏
- 实战:sqlserver 数据实时同步到mysql
- CouldnotcreateServerSocketonaddress0.0.0.0/0.0.0.0:9083
- (iOS)Storyboard/xib小技巧
- java文字转成拼音
- 向EXECL文件中导入数据的同时插入图片
- 关闭Excel提示文件格式和扩展名不匹配的警告框
- fopen fclose feof fgets fetl
- C语言函数-strcat
- 大数据面试题——如何找出访问最多的IP
- Generative Adversarial Nets[EBGAN]
- [20180316]共享服务模式和直接路径读.txt
- ethereum/EIPs-161 State trie clearing
- Unity3D学习笔记(二十五):Json