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 scroll to the top which is the expected behavior within iOS apps.
I tried :
[self.tableView setScrollsToTop:YES];
but the tableview still not scroll to top when tap the top of the screen.
You have to set
scrollsToTop
toNO
on all the other scroll views in your hierarchy. If more than one scroll view hasscrollsToTop
set toYES
, none of them will scroll to top when the status bar is touched. This is mentioned in the documentation of thescrollsToTop
property.Keep in mind that this also applies to any subclasses of
UIScrollView
in your view hierarchy, and thatUITableView
,UIContainerView
, andUITextView
are subclasses ofUIScrollView
.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