how to make a UITableView return to the top at xcode?
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?
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];
精彩评论