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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
回答2:
Like Jack said, you can only have one subclass of UIScrollView
(usually the table view) that has the scrollsToTop
property set to YES
. Likely you have others, typically UITextView
in your view. Just set their scrollsToTop
property to NO
and you're good to go.
回答3:
Also check scrollsToTop
in all container views if you have ones.