开发者

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜