iOS-UITableView scrollToRowAtIndexPath 首次滚动异常问题

方案一

[self.tableView reloadData];
[self.tableView layoutIfNeeded];
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];

方案二

self.tableView.contentInset = UIEdgeInsetsMake(self.tableView.contentInset.top, 0, self.tableView.frame.size.height, 0);
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:index inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];

你可能感兴趣的:(iOS-UITableView scrollToRowAtIndexPath 首次滚动异常问题)