- - (void)scrollTableToFoot:(BOOL)animated {
- NSInteger s = [self.chatTable numberOfSections];
- if (s<1) return;
- NSInteger r = [self.chatTable numberOfRowsInSection:s-1];
- if (r<1) return;
- NSIndexPath *ip = [NSIndexPath indexPathForRow:r-1 inSection:s-1];
- [self.chatTable scrollToRowAtIndexPath:ip atScrollPosition:UITableViewScrollPositionBottom animated:animated];
- }
UItableview滚动到最后一行
最新推荐文章于 2023-04-11 15:11:27 发布
本文介绍了一个用于将自定义聊天界面中的表格视图自动滚动到最后一行的方法。该方法首先检查表格是否有有效的部分和行数,然后使用 NSIndexPath 创建一个指向最后一行的索引路径,并通过 scrollToRowAtIndexPath 方法将表格滚动到该位置。
1280

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



