链接两个 UIScrollView,以便它们相互跟随
可能的重复:
将两个 UIScrollView 连接在一起
我想制作一个列表,分为两部分,左侧和右侧正确的。左侧部分只能垂直滚动(其中有一个列表)。右侧部分垂直和水平滚动。
所以,我想要一个左侧有一个列表、右侧有一个视图的控件,两者都检测滚动。但左侧部分始终保留在屏幕上,并且仅垂直移动,右侧部分也可以左右滚动..我希望你理解这一点:p..我认为
我会这样做的方式是: - 制作 2 个滚动视图 - 子类化滚动视图和捕捉触摸 - 将触摸镜像到另一个滚动视图
然后只需关闭左侧滚动视图的水平滚动.. 哈哈,我错了,自 OS 3.0 以来,Apple 似乎已经关闭了 UIScrollView 类上的捕获事件。
除了编写一个处理其自己的滚动的完全自定义控件之外,是否有人对如何执行此操作有其他想法?
Possible Duplicate:
Connect two UIScrollView's together
I want to make a list, that is divided in 2 parts, left and right. The left part can only scroll vertically (has a list in it). The right part scrolls vertically, and horizontally..
So, I want a control that has a list on the left side, and a view on the right side, both detect scrolls. But the left part always stays on the screen, and only moves vertically, the right part may scroll left and right as well.. I hope you understand this :p..
The way I thought I would do it, was:
- Make 2 scrollviews
- Subclass both scrollviews and catch touches
- Mirror the touches to the other scrollview
And then just turn off horizontal scrolling on the left Scrollview..
HAHA, I'm wrong, Apple seems to have turning off catching events on UIScrollView classes since OS 3.0..
Has anyone got another idea on how to do this, except for writing a completely custom control that handles it's own scrolls?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您能否在两个滚动视图之上放置一个透明视图,将触摸事件传递给两者?
Could you put a transparent view on top of both scrollviews that passes touch events to both?