UPDATED: (after @EranMarom pointed out his comment)
You can stop horizontal scrolling or vertical scrolling in the ScrollViewDelegate method. Like this,
Stop horizontal scrolling:
If you want to scroll horizontally, you need to increase contentOffset.x. Prevent horizontal scroll scrolling from stopping.
- (void)scrollViewDidScroll:(UIScrollView *)sender { sender.contentOffset.x = 0.0 }
Stop vertical scroll:
If you want to scroll vertically, you need to increase contentOffset.y. Prevents stopping scroll scrolling in the vertical direction.
- (void)scrollViewDidScroll:(UIScrollView *)sender { sender.contentOffset.y = 0.0 }
The above code prevents changes in x and y for scrollview contentOffset and causes the scroll to stop in the scrollViewDidScroll: method.
Dinesh Raja Jun 09 '13 at 12:08 on 2013-06-09 12:08
source share