2016-05-06 20 views
0

所以在我的自定义UITableViewCell中,每个UILongTapGestureRecognizer都有4个不同的UIImageView的&。
Table View Cells before adding images在同一个UITableViewCell中模糊不同的UIImage

后,我添加图片和表看起来像这样: ​​

我需要能够长按手势识别,之后删除图像时所选定的图像模糊出来按钮显示删除。

我已经添加了长按手势识别器的方法,虽然我明白,我需要应用模糊到选定的图像,而不是UIImageView本身,我似乎并没有得到如何将所选图像的引用传递给这样我就可以将模糊滤镜应用到图像上。 委托人在这种情况下是否合法使用?

回答

0

为了应用您提到的模糊效果,您需要图像本身。 你可以尝试这样的事情:)

UIImage *image = [yourImageView image]; 
UIImage *blurredImage = [UIImageEffects imageByApplyingBlurToImage:image withRadius:30 tintColor:tintColor saturationDeltaFactor:1.8 maskImage:nil]; 
yourImageView.image = blurredImage; 

你可以从这里得到UIImageEffects苹果文件: https://developer.apple.com/library/ios/samplecode/UIImageEffects/Listings/UIImageEffects_main_m.html

希望它能帮助:)

相关问题