Im developing an iPad application and in my app, Im using an outer scroll view and an inner scroll view. Outer scroll view is used for vertical scrolling and the inner one is used for horizontal scrolling. I have several of those inner scroll views as well.
我正在开发一个iPad应用程序,在我的应用程序中,我使用外部滚动视图和内部滚动视图。外滚动视图用于垂直滚动,而内部滚动视图用于水平滚动。我也有一些内部滚动视图。
What I need to do is to separate the vertical scrolling and the horizontal scrolling where wen the user scrolls vertically only the outer scroll view responds and when the user scrolls horizontally the inner scroll view responds.
我需要做的是分离垂直滚动和水平滚动,用户垂直滚动时,只有外部滚动视图响应,用户水平滚动时,内部滚动视图响应。
Now whats happening is wen the user put his/her finger on one of the inner scroll views and try to scroll vertically it doesnt scroll properly...
现在的情况是,用户把手指放在一个内部的滚动视图上,试着垂直滚动,它不能正常滚动……
1 个解决方案
#1
5
First of all,
首先,
take this problem in 3 steps,
用三个步骤来解决这个问题,
- Enable only vertical scrolling for outer scroll view and use
- 只允许为外部滚动视图和使用垂直滚动
_scrollview.showsHorizontalScrollIndicator
= NO;
_scrollview。showsHorizontalScrollIndicator =没有;
2.Enable only Horizontal scrolling for inner scroll view and use
2。只允许水平滚动内部滚动视图和使用
_scrollview.showsVerticalScrollIndicator
= NO;
_scrollview。showsVerticalScrollIndicator =没有;
3.Use a swipe gesture,
3所示。使用滑动手势,
Use a swipe gesture with direction top and bottom and add that gesture to the outer scroll view.
使用顶部和底部方向的滑动手势,并将该手势添加到外部滚动视图中。
use a swipe gesture with direction left and right and add that gesture to the inner scroll view.
使用左右方向的滑动手势,并将该手势添加到内滚动视图中。
#1
5
First of all,
首先,
take this problem in 3 steps,
用三个步骤来解决这个问题,
- Enable only vertical scrolling for outer scroll view and use
- 只允许为外部滚动视图和使用垂直滚动
_scrollview.showsHorizontalScrollIndicator
= NO;
_scrollview。showsHorizontalScrollIndicator =没有;
2.Enable only Horizontal scrolling for inner scroll view and use
2。只允许水平滚动内部滚动视图和使用
_scrollview.showsVerticalScrollIndicator
= NO;
_scrollview。showsVerticalScrollIndicator =没有;
3.Use a swipe gesture,
3所示。使用滑动手势,
Use a swipe gesture with direction top and bottom and add that gesture to the outer scroll view.
使用顶部和底部方向的滑动手势,并将该手势添加到外部滚动视图中。
use a swipe gesture with direction left and right and add that gesture to the inner scroll view.
使用左右方向的滑动手势,并将该手势添加到内滚动视图中。