Tag: uivisualeffectview

如何淡入UIVisualEffectView和/或UIBlurEffect进出?

我想用UIBlurEffect淡入一个UIVisualEffectsView: var blurEffect = UIBlurEffect(style: UIBlurEffectStyle.Dark) var blurEffectView = UIVisualEffectView() blurEffectView = UIVisualEffectView(effect: blurEffect) 我在一个UIButton调用的函数中使用普通animation淡入淡出,但.alpha = 0 & hidden = true : UIView.animateWithDuration(1, delay:0, options: .CurveEaseOut, animations: { self.blurEffectView.alpha = 1 }, completion: { finished in self.blurEffectView.hidden = false }) 现在,在两个方向上的衰落都可以工作,但是当淡出时它会给我一个错误:要求<UIVisualEffectView 0x7fdf5bcb6e80> is being asked to animate its opacity. This will cause the effect to […]