//指定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定位到目标单元格并触发滚动动画。
部署运行你感兴趣的模型镜像
您可能感兴趣的与本文相关的镜像
Langchain-Chatchat
AI应用
Langchain
Langchain-Chatchat 是一个基于 ChatGLM 等大语言模型和 Langchain 应用框架实现的开源项目,旨在构建一个可以离线部署的本地知识库问答系统。它通过检索增强生成 (RAG) 的方法,让用户能够以自然语言与本地文件、数据库或搜索引擎进行交互,并支持多种大模型和向量数据库的集成,以及提供 WebUI 和 API 服务
1391

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



