您的位置:首页 > 产品设计 > UI/UE

UITableView回滚到顶部的几种方法

2016-02-19 17:04 573 查看
//***************方法一***************//
//回滚到表的最顶端
[self.tableView  scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];

//***************方法二***************//
[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];

//***************方法三***************//
NSIndexPath* indexPat = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPat atScrollPosition:UITableViewScrollPositionBottom animated:YES];
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: