美文网首页
iOS tableView 滑动到顶部

iOS tableView 滑动到顶部

作者: 化二缺 | 来源:发表于2019-06-21 09:38 被阅读0次

使用这个

[weakSelf.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO];

在使用

[tableView setContentOffset:CGPointZero animated:YES];

或者

[tableView scrollRectToVisible:CGRectMake(0,0,1,1) animated:YES];

的时候 有时候会因为 分页 复用等原因 滑动不到最顶部

相关文章

网友评论

      本文标题:iOS tableView 滑动到顶部

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