- (
void
)viewDidLoad {
[ super viewDidLoad ];
[ super viewDidLoad ];
self
.
imageView
= [[
UIImageView
alloc
]
initWithImage
:[
UIImage
imageNamed
:
@"4"
]];
self . imageView . frame = self . view . bounds ;
self . imageView . frame = self . view . bounds ;
/*UIBlurEffectStyleExtraLight, 白色效果
UIBlurEffectStyleLight,
中
UIBlurEffectStyleDark 黑色效果 */
UIBlurEffect *blurEffect = [ UIBlurEffect effectWithStyle : UIBlurEffectStyleExtraLight ];
self . blurView = [[ UIVisualEffectView alloc ] initWithEffect :blurEffect];
self . blurView . frame = self . view . bounds ;
// 透明度 0 透明 1 不透明
self . blurView . alpha = 0.3f ;
// 将毛玻璃效果添加到控件上
[ self . imageView addSubview : self . blurView ];
// 控件添加到视图上
UIBlurEffectStyleDark 黑色效果 */
UIBlurEffect *blurEffect = [ UIBlurEffect effectWithStyle : UIBlurEffectStyleExtraLight ];
self . blurView = [[ UIVisualEffectView alloc ] initWithEffect :blurEffect];
self . blurView . frame = self . view . bounds ;
// 透明度 0 透明 1 不透明
self . blurView . alpha = 0.3f ;
// 将毛玻璃效果添加到控件上
[ self . imageView addSubview : self . blurView ];
// 控件添加到视图上
[self.view addSubview:self.imageView];
}