iOS开发记录iOS学习开发iOS Developer

iOS UITableView回到顶部

2017-05-05  本文已影响1729人  方同学哈
//***************方法一***************//
[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];
上一篇 下一篇

猜你喜欢

热点阅读