我有圖,該旋轉是這樣的:CABasicAnimation上的UIView,兒童按鈕無法點擊
if view.layer.animation(forKey: kRotationAnimationKey) == nil { let rotationAnimation = CABasicAnimation(keyPath: "transform.rotation") rotationAnimation.fromValue = 0.0 rotationAnimation.toValue = Float(M_PI * 2.0) rotationAnimation.duration = duration rotationAnimation.repeatCount = Float.infinity view.layer.add(rotationAnimation, forKey: kRotationAnimationKey) }
有在此視圖中的多個小按鈕。
雖然父視圖正在旋轉並嘗試點按按鈕,但我無法點擊並且相應的操作方法未被調用。
請幫忙解決這個問題。
[用CAAnimation支持的用戶交互?]的可能重複(http://stackoverflow.com/questions/11110485/user-interaction-enabled-with-caanimation) – Carter
該帖子中給出的鏈接無效。任何幫助? –
工作鏈接在這裏:http://ronnqvi.st/hit-testing-animating-layers/。未來,請在嘗試之前嘗試使用Google搜索,這是使用Google搜索時的第一個搜索結果。 – Carter