//指定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-06-30 08:30:00 发布
本文介绍了一种在UITableView中通过代码实现将视图滚动到指定位置的方法。具体步骤包括:获取TableView的所有分区数量及特定分区的行数,然后使用NSIndexPath定位到目标单元格并触发滚动动画。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Qwen3-8B
文本生成
Qwen3
Qwen3 是 Qwen 系列中的最新一代大型语言模型,提供了一整套密集型和专家混合(MoE)模型。基于广泛的训练,Qwen3 在推理、指令执行、代理能力和多语言支持方面取得了突破性进展
1391

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



