UIScrollView内的UIScrollView [英] UIScrollView within UIScrollView

查看:94
本文介绍了UIScrollView内的UIScrollView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我如何将某个区域的滑动事件重定向到内部滚动视图?

解决方案

如果将UIScrollViews设置为只能在一个轴或另一个轴上滚动(即,为其适当设置其contentSize属性)只能垂直滚动,将其contentSize.width值设置为与其bounds.size.width相同)。那么他们应该工作,假设没有两个视图在同一轴滚动。通常,您的子视图垂直滚动,父视图水平滚动。


I have got a hierarchy where UIScrollviews exist within each other.

How may I redirect swipe events for a certain area to an inner scrollview?

解决方案

If you set your UIScrollViews to only be scrollable in one axis or the other (ie, set their contentSize property appropriately for this. To have a view only be scrollable vertically, set its contentSize.width value to be the same as its bounds.size.width). then they should just work, assuming that no two views scroll in the same axis. Usually, you'll have the 'child' views scroll vertically, and the parent view scroll horizontally.

这篇关于UIScrollView内的UIScrollView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆