【iOS】高斯模糊

UIImageView *bgImg = [[UIImageView alloc]initWithFrame:CGRectMake(0, 20, SCREEN_WIDTH, 187)];
bgImg.image = [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];

你可能感兴趣的:(【iOS】高斯模糊)