
关于UITableView如何跳转到最后一行或者任意指定行
1个回答
2014-12-16
展开全部
关于UITableView如何跳转到最后一行或者任意指定行。
其实现如下:
NSUInteger sectionCount = [self.tableView numberOfSections];
if (sectionCount) {
NSUInteger rowCount = [self.tableView numberOfRowsInSection:0];
if (rowCount) {
NSUInteger ii[2] = {0, rowCount - 1};
NSIndexPath* indexPath = [NSIndexPath indexPathWithIndexes:ii length:2];
[self.tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
}
转载,仅供参考,祝你愉快,满意请采纳。
其实现如下:
NSUInteger sectionCount = [self.tableView numberOfSections];
if (sectionCount) {
NSUInteger rowCount = [self.tableView numberOfRowsInSection:0];
if (rowCount) {
NSUInteger ii[2] = {0, rowCount - 1};
NSIndexPath* indexPath = [NSIndexPath indexPathWithIndexes:ii length:2];
[self.tableView scrollToRowAtIndexPath:indexPath
atScrollPosition:UITableViewScrollPositionBottom animated:YES];
}
}
转载,仅供参考,祝你愉快,满意请采纳。
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询