处理两个不同视图中的触摸

发布于 2024-10-03 11:18:10 字数 357 浏览 0 评论 0 原文

我在每个帧(0,0,320,480)的窗口上有两个视图(滚动视图和顶视图),

[window addsubview:scrollview];
[window addsubview:topview];

滚动视图中我正在进行缩放、捏合操作,在顶视图视图中我有放置了一些按钮。我的问题是我想处理对两个视图的触摸,就像用户可以在滚动视图中捏合一样,而且他必须能够按下顶视图上的按钮。 (我没有在滚动视图上添加顶视图,因为如果我添加它们也会滚动,这些按钮就会被修复)。

我一次只能接触到一个视图。如何处理对两个子视图的触摸任何想法。

谢谢,

I Have two views(scrollview and topview) on a window each of frame (0,0,320,480),

[window addsubview:scrollview];
[window addsubview:topview];

In scrollview i am doing zooming,pinching operation and in topview view i have placed some buttons. My problem is i want to handle touches to both views like user can do pinching in scrollview and also he must be able to press buttons on topview. ( I am not adding topview on scrollview because these buttons are fixed if i add they also scroll).

I am getting touches to only one view at a time. How to handle touches to both subviews any idea.

Thanks,

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

关于从前 2024-10-10 11:18:10

你在俯视图中看到了什么?只有按钮?

如果是,则将它们从顶视图中移除,并将它们直接放置在窗户上并将它们带到前面。

What are you having in top view? only buttons?

If yes, then remove them from top view and place them directly on to the window and bring them to front.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文