ios 毛玻璃效果(高斯模糊)
2016-07-27 本文已影响494人
爱恨的潮汐
// ios 毛玻璃效果(高斯模糊)
UIImageView *bgImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 187)];
bgImg.image = [UIImage imageNamed:@"启动图标最终版"];
NSURL * nads = [NSURL URLWithString:self.datause[0][@"image"]];
[bgImg sd_setImageWithURL:nads placeholderImage:[UIImage imageNamed:@"启动图标最终版"]];
bgImg.contentMode = UIViewContentModeScaleAspectFill;
bgImg.clipsToBounds = YES;
[self.view addSubview:bgImg];
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
effectview.frame = CGRectMake(0, 0, bgImg.frame.size.width, 187);
[bgImg addSubview:effectview];