Reputation: 33110
I have a tableView that have at least 30 data. and then at the navigatorController i have a button that will change the view to another view. but if i want to back to my tableView i want to make the tableView return to the top? there are any code to make it work?
Upvotes: 1
Views: 4451
Reputation: 44633
UITableView
is a UIScrollView
subclass so you can use its setContentOffset:animated:
method to scroll to the top. You can do something like this in the viewWillAppear:
method -
[self.tableView setContentOffset:CGPointZero animated:NO];
Upvotes: 13