//指定tableView滚动的位置
if (!IsStrEmpty(_selectCommentID)) {
//获取所有分区
NSUInteger sectionCount = [self.baseTableView numberOfSections];
if (sectionCount) {
//获取分区所有行
NSUInteger rowCount = [self.baseTableView numberOfRowsInSection:1];
if (rowCount) {
NSUInteger rowSection[2] = {1, rowCount - 1};
NSIndexPath *indexPath = [NSIndexPath indexPathWithIndexes:rowSection length:2];
[self.baseTableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
}
if (_comListArray.count > 0 && !IsStrEmpty(_selectCommentID)) {
[self.baseTableView selectRowAtIndexPath:[NSIndexPath indexPathForRow:_scrollSelectedRow inSection:1] animated:YES scrollPosition:UITableViewScrollPositionBottom];
}
}
tableView滚动到指定行
最新推荐文章于 2024-07-08 11:19:23 发布