0
단추를 클릭했을 때 background_image가 흐림 효과로 바뀝니다.단추로 사용하려면 BlurEffect를 먼저 제거하십시오.
@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.
})
}
}
버튼을 다시 클릭하면 바로 효과를 제거 할 수 있습니까?
당신은 또한 단지'말할 수있는 경우 blurView = imageBackground.viewWithTag (태그 : 1000)을 보자 {...}' – creeperspeak
덕분에 남자 ,하지만 여전히 작동하지 않습니다. 이 태그를 어디에 추가해야합니까? 이 코드를 다른 코드보다 먼저 작성해야합니까? 고마워요 –
@ EloyuF.Bent 코드를 추가했습니다. – JuicyFruit