滚动视图中滚动视图的水平滚动 - 小问题
我有一个适合整个屏幕的滚动视图。在该视图中,我显示了一些水平滚动的 UIImages。就像 Apple 的 PageControl 项目一样。 然后,当用户点击屏幕时,我会淡入底部的滚动视图以及一些其他图像。也可以水平滚动。就像 Apple 的 ScrollView 项目一样。
我的问题是,当我到达淡入的滚动视图的末尾时,上方的滚动视图也开始拖动。在激活第二个滚动视图期间如何停止它?
i have a scrollView that fits the whole screen. In that View i show some UIImages that scroll horizontally. Like in the PageControl Project from Apple.
Then, when the user taps the screen, i fade in a scrollView at the bottom with some other images. Also horizontally scrolling. Like in the ScrollView Project from Apple.
My problem is, that when i come to the end of the scrollView which was faded in, the upper scrollView also starts to drag. How can i stop that during activation of the second scrollView?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当第二个滚动视图进入屏幕时,重新绘制第一个滚动视图的帧限制。这样,您的触摸就不会同时响应这两种视图。这意味着您需要一个容器视图来保持两个视图彼此分离。
然后,每当第二个滚动视图消失时,您只需将其重新缩放即可。
编辑:或在第二个滚动视图打开时禁用第一个滚动视图中的滚动。
Redraw the frame limits on your first scrollView when the second enters the screen. That way, your touches won't respond to both views. This means you need a container-view to keep both views seperated from each other.
Then you just rescale it back whenever your second scrollView disappears.
Edit: or disable scroll in your first scrollview while the second is open.