如何检测动画子视图上的触摸?还是单击动画的UIButton? [英] How can I detect a touch on an animated subview ? Or click an animated UIButton?

查看:76
本文介绍了如何检测动画子视图上的触摸?还是单击动画的UIButton?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的观点一直在动。视图有时在屏幕上,有时在屏幕外-它是屏幕宽度的两倍。
在此视图中,我需要单击一些按钮。
我已经尝试过很多方法-使用纯按钮
在UIView上开始使用触摸

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

我正在使用核心动画中的CGPath

I'm doing the animation using a CGPath in core animation

任何帮助将是最感激的

谢谢

推荐答案

视图是否在移动是否与触摸检测无关。如果您有UIButton对象并且正在处理UIEventControlTouchUpInside(忘记确切名称)事件,则在看到触摸时应调用该事件。那对你不起作用吗?

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. Is that not working for you?

这篇关于如何检测动画子视图上的触摸?还是单击动画的UIButton?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆