UIScrollview 无法保持水平
我有 2 个彼此相邻的 UIScrollview
。 它们因其垂直价值而联系在一起。 (向上和向下)
事实证明,当我在两个视图上绘制某种图形时(实际上在每个视图中......但图形(一条线)在视觉上是交叉的)。在某个时刻,当你 疯狂地平移并开始加速和减速,滚动视图不会保持水平。 当停止此操作时,它们会再次升级(以某种动画方式),但我实际上希望它们无论用户做什么都粘在一起。
我玩了很多,但我已经没有想法了,所以任何帮助将不胜感激。
谢谢
汤姆
I have 2 UIScrollview
s next to each other.
They are hooked up together on their vertical-value. (up and down)
As it turned out as I drew some sort of graphic across both views (actually in each of the views... but the graphic (a line) goes visually across). At some point when you
pan wildly around and start accelerating and decelerating it, the scrollviews don't keep level.
When stopping this, they level up again (in some sort of animation), but I actually want them to stick together no matter what the user does.
I played around a lot, but I am running out of ideas, so any help would be greatly appreciated.
Thank you
Tom
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
所以如果你缓慢平移它会起作用吗?
我认为这取决于你如何将 uiscrollviews 连接在一起......我的意思是你将垂直值从一个传递到另一个,但不是加速度,不是吗?请发布一些代码
so it works if you're panning slowly?
i think it depends on how you hook uiscrollviews together... i mean you're passing vertical values from one to the other one but not the acceleration isn't it? post some code please
是的,它运作缓慢。如果我平移速度非常快,它甚至会很有效,但如果我做了很多停止和加速之类的事情,它就会崩溃。
基本上我在我的视图控制器中创建了我的 uiscrollview 并将它们连接到 IB 中。
我正在使用 scrollviewdidScroll-delegate-method 来保持它们同步。我也用 KVO 尝试过,但没有区别。有趣的是,我在内容滚动视图之上也有一个滚动视图。无论我在做什么,我都从未设法使它们(内容滚动和列滚动)不同步。
(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (scrollView.dragging ||scrollView.tracking)
{
}
谢谢
汤姆
yeah, it works slowly. it works even sweet if I pan very quickly, but it breaks if i do a lot of stopping and accelerating and stuff.
basically I created my uiscrollview in my viewcontroller and hooked them up in IB.
i am using the scrollviewdidScroll-delegate-method to keep them synchronised. i tried it with KVO as well, but no difference. the funny thing is, I have a scrollview on top of the content-scrollview too. I have never managed to get them(contentscroll and columnscroll) out of sync, no matter what I am doing.
(void)scrollViewDidScroll:(UIScrollView *)scrollView
{
if (scrollView.dragging || scrollView.tracking)
{
}
thank you
Tom