关于点击状态栏回到顶部的功能失效

来源:互联网 发布:公司域名怎么申请 编辑:程序博客网 时间:2024/04/30 12:45

                                                                               关于点击状态栏回到顶部的功能失效

iOS 下 UITableView/UIScrollView 有个特性:点击状态栏回到顶部。如果当前 view 下有多个 scrollView,或者多个 tableView 嵌套,点击回到顶部就无效,因为系统不知道该响应哪个,索性就全部禁用。文档:

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.

找到了原因解决也就很简单:只保留需要点击回到顶部 scrollView.scrollsToTop = YES,其他全部禁用。

0 0
原创粉丝点击