scrollsToTop summary:
UIScrollView is a class used to display scrolling. He has subclasses such as UITableView and UITextView.
scrollsToTop is a property of UIScrollView, which is mainly used to scroll back to the top when the control with scrollsToTop == YES is clicked on the status bar of the device.
For each default instance of UIScrollView, its scrollsToTop property defaults to YES, so to implement a UIScrollView instance to click the device status bar to return to the top, you need to close the scrollsToTop property of other UIScrollView instances to NO. It's easy to understand: if multiple scrollViews respond to the event of returning to the top, the system will not know which scrollView to return to the top, so it will not do anything. . .
Take a chestnut:
Only when a UIViewController controller has a scrollview and set this property to yes,
_photoList.table.scrollsToTop = NO;
_starList.table.scrollsToTop = NO;
Understand? It should be noted that UIWebView contains subview UIWebViewScrollView, which is also a subclass of UIScrollView. I didn’t realize this at the beginning, which made it impossible to click the status bar to return to the top. Set the scrollsToTop of UIWebViewScrollView to NO, which is normal.