我们先看看官方是怎么说的
// When the user taps the status bar, the scroll view beneath the touch which is closest to the status bar will be scrolled to top, but only if its `scrollsToTop` property is YES, its delegate does not return NO from `shouldScrollViewScrollToTop`, and it is not already at the top.
// On iPhone, we execute this gesture only if there's one on-screen scroll view with `scrollsToTop` == YES. If more than one is found, none will be scrolled.
@property(nonatomic) BOOL scrollsToTop; // default is YES.
大概意思就是 当用户点击statusbar的时候,如果你的scrollview满足以下条件1scrollsToTop是Yes 2.shouldScrollViewScrollToTop 返回的时Yes 3.scrollView有滑动一段距离
scrollView就会滑到顶部即scrollView.contentOffset 为0。
但是如果超过一个的scrollView的属性设置为Yes,那么scrollToTop就没有效果了 大家都不会执行
接下来大家都知道该怎么改了