Reputation: 16653
I have a UIScrollView with paging enabled, and that works fine.
Now I want to 'lock' the UIScrollView on a specific page, prevent the user from scrolling to the next or previous page. How would I go about this?
Upvotes: 0
Views: 1168
Reputation: 1313
- (void)scrollViewDidScroll:(UIScrollView *)scrollView{
if(currentPage == 4)
[scrollView setScrollEnabled:NO]; // when the page is "4", scroll will be locked
//or
[scrollView setUserInteractionEnabled:false];
}
Upvotes: 1
Reputation: 16827
You could just disable the interaction
scrollView.interactionEnabled = NO;
Unless you want interaction within that page?
Upvotes: 0