//使用图片初始化
UIImageView *imm = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 220)];
[imm setImage:[UIImage imageNamed:@"2.jpg"]];
[self.view addSubview:imm];
//添加模糊
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
effectview.frame = CGRectMake(0, 0, imm.frame.size.width, 220);
[imm addSubview:effectview];
网友评论