iOS8 模糊效果

96
AKinCoder
2016.08.16 15:21* 字数 66

模糊效果有几种实现方式

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;

}



日记本