简体   繁体   English

如何检测动画子视图上的触摸? 还是单击动画的UIButton?

[英]How can I detect a touch on an animated subview ? Or click an animated UIButton?

I have a view that is moving. 我的观点是动人的。 The view is sometimes on and sometimes off screen - it is twice the width of the screen. 该视图有时在屏幕上,有时在屏幕外-它是屏幕宽度的两倍。 In this view, there are buttons that I need to be able to click. 在此视图中,需要单击一些按钮。 I've tried doing this in many ways already - using pure buttons using touches began on UIView 我已经尝试过以多种方式执行此操作-在UIView上开始使用纯按钮进行触摸

I'm doing the animation using a CGPath in core animation 我在核心动画中使用CGPath进行动画

Any help would be most appreciated 非常感激任何的帮助

Thanks 谢谢

Whether the view is moving or not should irrelevent to the touch detection. 视图是否在移动应该与触摸检测无关。 If you have a UIButton object and are handling the UIEventControlTouchUpInside (forgot the exact name) event , it should be called when it sees a touch. 如果您有UIButton对象并且正在处理UIEventControlTouchUpInside(忘记确切名称)事件,则在看到触摸时应调用该事件。 Is that not working for you? 那对你不起作用吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM