美文网首页
【bug】_contentOffsetForScrollingT

【bug】_contentOffsetForScrollingT

作者: frola_ | 来源:发表于2019-04-29 16:26 被阅读0次
UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:usingPresentationValues:]: row (42) beyond bounds (42) for section (0).

在tableview reloadData的同事,定位到最后一行,tableview还没有刷新完,就会引起崩溃

解决办法

    CGPoint offset = CGPointMake(0,self.tableview.contentSize.height - self.tableview.frame.size.height);
    [self.tableview setContentOffset:offset animated:NO];

放弃

[self.tableview scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:count - 1 inSection:0] atScrollPosition:UITableViewScrollPositionNone animated:NO];

相关文章

网友评论

      本文标题:【bug】_contentOffsetForScrollingT

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