美文网首页
UITableView快速回到顶部

UITableView快速回到顶部

作者: iHugo_0 | 来源:发表于2017-03-08 15:17 被阅读0次

UITableView快速回到顶部有三种方法:
(1)[self.tableView scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:NO];

(2)[self.tableView setContentOffset:CGPointMake(0,0) animated:NO];

(3)NSIndexPath* indexPat = [NSIndexPath indexPathForRow:0 inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPat atScrollPosition:UITableViewScrollPositionBottom animated:YES];

相关文章

网友评论

      本文标题:UITableView快速回到顶部

      本文链接:https://www.haomeiwen.com/subject/rfpdbttx.html