I know this is pretty old, but hope this can help. Following what @MarkGranoff said, scrollsToTop does not work if more than one UIScrollView or its subclasses is YES (the default value), a health check is probably worth checking who actually messed up this behavior. The simple method below is over the views of your view and registers the scrollsToTop value for the entire UIScrollView in your view. It is preferable to call viewDidAppear in your method.
- (void)checkForScrollViewInView:(UIView *)view { for (UIView *subview in [view subviews]) { if ([subview isKindOfClass:[UIScrollView class]]) { NSLog(@"scrollsToTop enabled: %i in scroll view %@", ((UIScrollView *)subview).scrollsToTop, subview); } if (subview.subviews.count > 0) { [self checkForScrollViewInView:subview]; } } }
This is really debugging code. When you find the scrollsToTop value for each of the UIScrollView subclasses, make sure that only one of them is set to YES.
DennyLou Aug 21 '15 at 4:07 2015-08-21 04:07
source share