UIBlurEffect实现模糊效果
生活随笔
收集整理的這篇文章主要介紹了
UIBlurEffect实现模糊效果
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
//使用圖片初始化背景 Pattern 圖案,模式self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"加載頁-6"]];//實現模糊效果//1.UIVisualEffectView *visualEffectView = [[UIVisualEffectView alloc] initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]]; //Blur 模糊形狀,使模糊 Effect結果,效果//2.visualEffectView.frame = self.view.bounds;//3.visualEffectView.alpha = 0.5;//4.[self.view addSubview:visualEffectView]; //注意,不應該直接添加子視圖到UIVisualEffectView視圖中,而是應該添加到UIVisualEffectView對象的contentView中。//typedef NS_ENUM(NSInteger, UIBlurEffectStyle) {// UIBlurEffectStyleExtraLight, //extra 額外的// UIBlurEffectStyleLight,// UIBlurEffectStyleDark//} NS_ENUM_AVAILABLE_IOS(8_0);
?
轉載于:https://www.cnblogs.com/10-19-92/p/5299062.html
總結
以上是生活随笔為你收集整理的UIBlurEffect实现模糊效果的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 天津首套房贷款利率
- 下一篇: 104.全排列(深搜)搜索与回溯