为什么UIScrollView / UITableview不响应状态栏上的水龙头,并滚动到顶部? [英] Why doesn't UIScrollView/UITableview respond to taps on the status bar, and scroll to the top?

查看:138
本文介绍了为什么UIScrollView / UITableview不响应状态栏上的水龙头,并滚动到顶部?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我点击状态栏时,我的应用程序中的 UIScrollView 没有响应,并滚动到顶部。什么都没发生。什么原因可能导致 UIScrollView 忽略状态栏上的点击?

When I tap on the status bar, the UIScrollView in my app does not respond and scroll to the top. Nothing happens. What could cause the UIScrollView to ignore taps on the status bar?

推荐答案

UIScrollView (或 UIScrollView 的子类,例如 UITableView ),同一视图中的 scrollsToTop 属性设置为 YES UIScrollView 作为子视图添加到 UIScrollView 时。确保只有一个滚动视图的 scrollsToTop 属性设置为 YES 。正确的 UIScrollView 应该在状态栏上轻触事件。

This can occur when there are multiple instances of UIScrollView (or a subclass of UIScrollView, such as UITableView) with the scrollsToTop property set to YES on the same view, such as when a UIScrollView is added as a subview to a UIScrollView. Make sure that the scrollsToTop property of only one scroll view is set to YES. The correct UIScrollView should respond to tap events on the status bar after.

这篇关于为什么UIScrollView / UITableview不响应状态栏上的水龙头,并滚动到顶部?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆