iOS 滚动到tableView的最底部

升级iOS11之后,真机调试时发现

[self.tableView scrollToBottomAnimated:YES];

上述方法无法实现滚动到tableview的最底部。往往距离最后一个cell还有一定的距离。
于是改用下面这段代码

NSIndexPath *indexPath = [NSIndexPath indexPathForItem:self.dataSource.count - 1 inSection:0];
[self.tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];

完美实现。

你可能感兴趣的:(iOS 滚动到tableView的最底部)