- (void)initUI {
#pragma mark 需要添加毛玻璃效果的視圖
self.blurImgView = [[UIImageView alloc]initWithFrame:self.view.bounds];
[self.blurImgView downloadImage:imageUrl placeholder:@"default_room"];
[self.view addSubview:self.blurImgView];
#pragma mark 創(chuàng)建毛玻璃效果
UIBlurEffect * blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
#pragma mark 創(chuàng)建毛玻璃視圖
UIVisualEffectView * visualEV = [[UIVisualEffectView alloc]initWithEffect:blur];
visualEV.frame = self.blurImgView.bounds;
#pragma mark 毛玻璃視圖添加到需要毛玻璃效果的圖層上方
[self.blurImgView addSubview:visualEV];
}
屏幕快照 2016-12-20 下午5.03.16.png