iOS8之后系统自带毛玻璃效果
作者:
iOS_Coder | 来源:发表于
2016-12-20 17:09 被阅读35次- (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 创建毛玻璃效果
UIBlurEffect * blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
#pragma mark 创建毛玻璃视图
UIVisualEffectView * visualEV = [[UIVisualEffectView alloc]initWithEffect:blur];
visualEV.frame = self.blurImgView.bounds;
#pragma mark 毛玻璃视图添加到需要毛玻璃效果的图层上方
[self.blurImgView addSubview:visualEV];
}

屏幕快照 2016-12-20 下午5.03.16.png
本文标题:iOS8之后系统自带毛玻璃效果
本文链接:https://www.haomeiwen.com/subject/kbcfvttx.html
网友评论