模糊效果有几种实现方式
1.GPUImage
2.coreIamge
3.UIBlurEffect (iOS8+)
上代码:
if (!_blurView) {
UIImageView * imgView = [[UIImageView alloc] initWithFrame:self.bounds];
imgView.contentMode = UIViewContentModeScaleAspectFit;
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];
UIVisualEffectView *effectview = [[UIVisualEffectView alloc] initWithEffect:blur];
[effectview setFrame:self.bounds];
[imgView addSubview:effectview];
_blurView = imgView;
}
return _blurView;
}