UIButton not interacting during animation

后端 未结 5 1921
滥情空心
滥情空心 2020-12-11 15:26

I\'m trying to animate a UIButton. But during it\'s animation, there is no interaction with the UIButton. Expected behavior is to be able to click on the button while it\'s

5条回答
  •  Happy的楠姐
    2020-12-11 16:08

    Another option is to add a transparent button over the button you are animating. In your particular case you might not be able to use this, as you are moving the button, but you might be able to create an overlay button big enough to cover from the start position to the final one.

    I had this problem, and in my case using UIViewAnimationOptionAllowUserInteraction didn't work. I was animating the alpha of a UIButton inside a UIBarButtonItem (created with initWithCustomView:) to make a pulsating effect, and that option wouldn't work. I don't like the NSTimer option either (not smooth), so in the end I just added an overlay button, which I don't like, but works flawlessly.

提交回复
热议问题