石英 2D 绘图触摸问题开始
我在我的应用程序中画了 5 个圆圈,一个在另一个之上。但我想在触摸每个圆圈时执行不同的操作,并且只有一次触摸开始,我可以在整个视图中执行触摸。任何人都可以帮助我如何做到这一点。
I have drawn 5 circles in in my app one above the other . But i want to perform different operations when i touch each circle and there is only one touches began where I can perform touches for the entire view.. can anyone help me how to do that.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要么处理触摸的坐标以“抓取”特定的圆(如果您有原点和半径,您就知道它们的坐标),要么将每个圆放入其自己的视图中,并创建父视图的五个子视图/圆。将触摸沿着视图链传递,直到坐标重叠。
Either process the coordinates of the touch to "grab" a specific circle (you know their coordinates if you have the origins and radii), or put each circle into its own view, and make five subviews/circles of a parent view. Pass the touch down the view chain until the coordinates overlap.