iOS8苹果新增了毛玻璃接口:
UIImageView *imageV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, UI_SCREEN_WIDTH, UI_SCREEN_HEIGHT)];
imageV.image = [UIImage imageNamed:@"Dva2"];
imageV.contentMode = UIViewContentModeScaleAspectFill;
imageV.clipsToBounds = YES;
[self.view addSubview:imageV];
UIVisualEffectView *visualView = [[UIVisualEffectView alloc]initWithEffect:[UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]];
visualView.frame = imageV.bounds;
[imageV addSubview:visualView];
把UIVisualEffectView覆盖在图层上即可,effectWithStyle:参数是个枚举,提供不同亮度的毛玻璃效果
WX20180508-125811@2x.png
网友评论