iOS8 模糊效果

2016-08-16  本文已影响17人  AKinCoder

模糊效果有几种实现方式

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;

}


上一篇 下一篇

猜你喜欢

热点阅读