[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
博客给出了一段代码,用于将UITableView滚动到顶部。代码通过指定索引路径和滚动位置,实现了滚动到第一行的功能,并可设置动画效果。
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];

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