我对UILabel的翻译正在进行动画处理。每当您在动画中点击标签时,轻按手势都没有响应。点击手势动画UIView无法正常工作
这里是我的代码:
label.addGestureRecognizer(tapGesture)
label.userInteractionEnabled = true
label.transform = CGAffineTransformMakeTranslation(0, 0)
UIView.animateWithDuration(12, delay: 0, options: UIViewAnimationOptions.AllowUserInteraction, animations: {() -> Void in
label.transform = CGAffineTransformMakeTranslation(0, 900)
}, completion: nil)
动作代码:
func setUpRecognizers() {
tapGesture = UITapGestureRecognizer(target: self, action: "onTap:")
}
func onTap(sender : AnyObject) {
print("Tapped")
}
任何想法?谢谢:)
也许这将帮助你http://stackoverflow.com/questions/26210318/tap-gesture-with-uigesturerecognizerstate-not-working – owlswipe
显示您双击手势初始化代码。 – sschale
@sschale编辑 – mlevi