views:

445

answers:

2

Using the Apple's PageControl sample code I've managed to put several UIWebViews side-by-side, and I'm able to swipe left and right in order to get to each web view.

I can also scroll up/down to scroll within each web view. However, I have to move my finger very precisely along the y-axis to get the webview to scroll up/down - otherwise it will slide left or right and show a neighbouring view.

Is there a way to reduce the sensitivity of the left/right scrolling (or increase the sensitivity of the up/down)? Or is there another technique I should be using?

+1  A: 

It might be a bit elaborate, but try checking if the UIWebView's scrolling property is true, if it's true, disable scrolling on the UIScrollView until the web view isn't scrolling anymore?

Jasarien
That sounds like a possible way. But is there a way to detect if a UIWebView is scrolling?
cannyboy
Hmm... not without exposing its UIScrollView... which Apple won't allow. Sorry, I thought the scroll view methods were exposed on UIWebView, it appears they're not.
Jasarien
+1  A: 

Try setting the property pagingEnabled = YES or directionalLockEnabled = YES on your UIScrollView. It won't be perfect, but it will certainly help.

pagingEnabled documentation

If the value of this property is YES, the scroll view stops on multiples of the view bounds when the user scrolls. The default value is NO

directionalLockEnabled documentation

If this property is NO, scrolling is permitted in both horizontal and vertical directions. If this property is YES and the user begins dragging in one general direction (horizontally or vertically), the scroll view disables scrolling in the other direction. If the drag direction is diagonal, then scrolling will not be locked and the user can drag in any direction until the drag completes. The default value is NO

bentford