由于最近项目需要实现alertView窗口高斯效果,在网上参考资料后总结了一下下。具体如下:
自定义alertView窗口后,添加高斯效果,如下:
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
effectview.frame = CGRectMake(0, 0, alertviewWidth, 250);
[effectview setBackgroundColor:CLEARCOLOR];
[self.alertview addSubview:effectview];
ios8后可以无损使用哈,希望能帮助到你
本文介绍如何为iOS中的alertView添加高斯模糊效果。通过创建UIBlurEffect并将其应用于UIVisualEffectView,可以轻松实现这一视觉增强。适用于iOS 8及更高版本。
1万+

被折叠的 条评论
为什么被折叠?



