我一直在尝试使用UIImageView在xcode 6(swift语言)中实现模糊效果,我想实现的是使ImageView下面的所有内容都变模糊。
但我无法让它生效,所以我向stackoverflow上的大家求助,请帮帮我。
应该如何实现呢?
到目前为止,我写的代码是:
class blurImage: UIImageView {
init(frame: CGRect) {
super.init(frame: frame)
var blur:UIBlurEffect = UIBlurEffect(style: UIBlurEffectStyle.Light)
var effectView:UIVisualEffectView = UIVisualEffectView (effect: blur)
}
}
Objective C
代码吗?如果有,具体是哪个过渡部分引起了问题?如果没有,那么这可能是一个相当广泛的问题。 - A-LiveUIInterpolatingMotionEffect
和UiView -addMotionEffect:
(在iOs7+上可用)。 - A-Live