UITableView scroll to top when tapping status bar at top of the screen

后端 未结 2 579
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-25 08:52

I inserted a UITableView inside another UIViewController\'s view. but when I tap the status bar at the top of the screen; the table view doesn\'t s

相关标签:
2条回答
  • 2020-12-25 09:38

    Thanks for all, i resolved this problem by removing all other UITableView from the parent ViewController, and then auto scroll to top was working for this UITableView..

    thanks

    0 讨论(0)
  • 2020-12-25 09:51

    You have to set scrollsToTop to NO on all the other scroll views in your hierarchy. If more than one scroll view has scrollsToTop set to YES, none of them will scroll to top when the status bar is touched. This is mentioned in the documentation of the scrollsToTop property.

    Keep in mind that this also applies to any subclasses of UIScrollView in your view hierarchy, and that UITableView, UIContainerView, and UITextView are subclasses of UIScrollView.

    0 讨论(0)
提交回复
热议问题