【发布时间】:2017-08-05 10:41:39
【问题描述】:
我有一个按钮,当我点击它时,我的 background_image 会变成模糊效果。
@IBAction func button_MainClicked2(_ sender: UIButton) {
if button_MainCenter == button_viajes.center{
UIView.animate(withDuration: 0.6, animations:
{
let blur = UIBlurEffect(style: UIBlurEffectStyle.light)
let blurView = UIVisualEffectView(effect: blur)
blurView.frame = self.image_Background.bounds
self.image_Background.addSubview(blurView)
})
} else {
UIView.animate(withDuration: 0.6, animations: {
// I want to remove blur effect as soon as i press the button again.
})
}
}
如何修复它以在单击返回按钮时立即消除效果?
【问题讨论】:
标签: swift button blur effect uiblureffect