Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't UIScrollView/UITableview respond to taps on the status bar, and scroll to the top?

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?

like image 598
Jack Humphries Avatar asked Aug 22 '13 01:08

Jack Humphries


2 Answers

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.

like image 141
Jack Humphries Avatar answered Oct 14 '22 07:10

Jack Humphries


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.

like image 23
George Avatar answered Oct 14 '22 06:10

George