//指定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滚动到指定行
滚动TableView到指定位置
最新推荐文章于 2024-06-30 08:30:00 发布
本文介绍了一种在UITableView中通过代码实现将视图滚动到指定位置的方法。具体步骤包括:获取TableView的所有分区数量及特定分区的行数,然后使用NSIndexPath定位到目标单元格并触发滚动动画。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Yolo-v8.3
Yolo
YOLO(You Only Look Once)是一种流行的物体检测和图像分割模型,由华盛顿大学的Joseph Redmon 和Ali Farhadi 开发。 YOLO 于2015 年推出,因其高速和高精度而广受欢迎
1391

被折叠的 条评论
为什么被折叠?



