折腾:
期间,自己发现还有个:scrollViewDidScrollToTop
想要拿来直接去用,结果不行。
所以要去搞懂其含义。
然后自己去写代码,发现有个:
scrollViewDidScrollToTop
func scrollViewDidScrollToTop(scrollView: UIScrollView) {
去搜:
scrollViewDidScrollToTop
iphone – How can I get scrollViewDidScrollToTop to work in a uiTableView? – Stack Overflow
scrollViewDidScrollToTop 是什么时候出发的? | iOS开发 – CocoaChina CocoaChina_让移动开发更简单
UIScrollViewDelegate Protocol Reference
“- scrollViewDidScrollToTop:
Tells the delegate that the scroll view scrolled to the top of the content.
Declaration
SWIFT
optional func scrollViewDidScrollToTop(_ scrollView: UIScrollView)
OBJECTIVE-C
– (void)scrollViewDidScrollToTop:(UIScrollView *)scrollView
Parameters
scrollView
The scroll-view object that perform the scrolling operation.
Discussion
The scroll view sends this message when it finishes scrolling to the top of the content. It might call it immediately if the top of the content is already shown. For the scroll-to-top gesture (a tap on the status bar) to be effective, the scrollsToTop property of the UIScrollView must be set to YES.
”
IOS UIScrollView常用代理方法 – linux_zkf的专栏 – 博客频道 – CSDN.NET
UIScrollView – scrollViewDidScrollToTop delegate method not firing – Google Groups
[总结]
scrollViewDidScrollToTop不是像字面意思那样,列表滚动到顶部,就可以被调用。
而实际上的滚动到顶部的调用,并不会调用scrollViewDidScrollToTop
而只是:
scrollsToTop设置为true后
并且scrollViewShouldScrollToTop返回true
然后再去点击状态栏,好像视图才回滚动到对应的顶部
才回执行scrollViewDidScrollToTop
大概是这个意思,总之不是我们所想要的。不去继续深究了。