开发者

How to go from last row to first row direstly in uitableview?

开发者 https://www.devze.com 2023-04-07 23:47 出处:网络
iam making one application.In that iam using UITableview.In that i places one button at the last row of the tableview.How we go to firs开发者_开发问答t row when we click on that button.So please tell

iam making one application.In that iam using UITableview.In that i places one button at the last row of the tableview.How we go to firs开发者_开发问答t row when we click on that button.So please tell me how to solve this one.


Use this:

NSIndexPath *topIndexPath;
topIndexPath = [NSIndexPath indexPathForRow:0 inSection:0];
[tableView scrollToRowAtIndexPath:topIndexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
0

精彩评论

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