I have a scrollView
of 280(w) x 350(h) and a content view
of 840(w) x 405(h).
I switch between the views with a segmented control
like this:
- (IBAction)segmentedClicked:(UISegmentedControl *)sender
{
CGFloat x = sender.selectedSegmentIndex * self.personalDetailsScrollView.frame.size.width;
CGPoint point = CGPointMake(x, 0);
[self.personalDetailsScrollView setContentOffset:point animated:YES];
}
I want to disable the regular horizontal scrolling so only the segmented buttons will scroll the view horizontally. The vertical scroll should stay active.
Tried to use -(void)scrollViewDidScroll and the solution offered here: (How to lock the horizontal scrolling of a scrollView in iOS) but it didn't work for me for some reason.