如何使UIBlurEffectStyleLight更加微妙?

时间:2016-01-14 21:47:28

标签: ios objective-c uiimageview

我正在将模糊效果应用到我的单元格backgroundView,如下所示:

// Setup imageView
UIImageView *imageView = [[UIImageView alloc]initWithImage:[UIImage imageWithData:imageData]];
imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.clipsToBounds = YES;

// create effect
UIBlurEffect *blur = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight];

// add effect to an effect view
UIVisualEffectView *effectView = [[UIVisualEffectView alloc]initWithEffect:blur];
effectView.frame = self.view.frame;

// add the effect view to the image view
[imageView addSubview:effectView];
cell.backgroundView = imageView;

问题在于,这适用的模糊效果太强,你几乎看不到图像:

enter image description here

有没有办法应用更微妙的模糊效果?我尝试了UIBlurEffectStyleExtraLightUIBlurEffectStyleDark,但这些只是改变了亮度,而不是模糊效果的强度。

0 个答案:

没有答案