UITapGestureRecognizer not work when I animate the UIImageView

前端 未结 2 1488
你的背包
你的背包 2021-02-20 14:02

When I want to animate the UIImageView, the UITapGestureRecognizer added to it can not work. WHY???

-(void) testTap:(id)sender {
    NS         


        
2条回答
  •  佛祖请我去吃肉
    2021-02-20 14:58

    Just to add to this for Swift...something like this will work very well... Use .AllowUserInteraction.

    UIView.animateWithDuration(0.4, delay: 1.5, usingSpringWithDamping: 0.5, initialSpringVelocity: 20, options: UIViewAnimationOptions.AllowUserInteraction, animations:
                    {self.frame = originalFrame}, completion: nil)
    

提交回复
热议问题