![](/img/trans.png)
[英]Swift How do I convert a UIImageView into a UIImage Without Losing blur effect
[英]How do I make my UIImageView be on top of the Blur Effect in Swift?
我正在使用此相机应用程序,正在拍摄照片后,视图变得模糊,包括捕获的图像。 我希望捕获的图像位于模糊效果之上,这样它就不会变得模糊,用户可以看到他们拍摄的照片。 我该怎么做? 这是我目前拥有的代码:
if !UIAccessibilityIsReduceTransparencyEnabled() {
self.view.backgroundColor = UIColor.clearColor()
let blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
blurEffectView.frame = self.view.bounds
blurEffectView.autoresizingMask = [.FlexibleWidth, .FlexibleHeight]
self.view.addSubview(blurEffectView)
}
else {
self.view.backgroundColor = UIColor.blackColor()
}
添加到效果视图内容视图的任何视图都不会模糊。 效果视图后面的任何视图都将被模糊。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.