iOS 点击状态栏回滚scrollView顶部

来源:互联网 发布:立体设计图软件 编辑:程序博客网 时间:2024/05/16 09:17

// 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.- (BOOL)scrollViewShouldScrollToTop:(UIScrollView *)scrollView;   // return a yes if you want to scroll to the top. if not defined, assumes YES


如果控制器有多个scrollView(scrollview 、tableview 、collectionview、webView),有且只能有一个该属性设为YES,才能触发这个效果。


0 0
原创粉丝点击