Ios 如何滚动通过UIPopoverController打开的UITableview
在iOS 4中,我有一个UIPopoverController,它打开一个UITableViewController,其中包含一长串项目(66)。Ios 如何滚动通过UIPopoverController打开的UITableview,ios,uitableview,scroll,uipopovercontroller,Ios,Uitableview,Scroll,Uipopovercontroller,在iOS 4中,我有一个UIPopoverController,它打开一个UITableViewController,其中包含一长串项目(66)。 如何以编程方式滚动到tableview的特定单元格?您可以使用UITableView的此方法: - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOO
如何以编程方式滚动到tableview的特定单元格?您可以使用
UITableView
的此方法:
- (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated
参数
让我澄清一下,这不是一个复制/重复的答案。你看,所有答案之间的时间差异都很小。好吧,我不是来争论这么愚蠢的事情的。不管怎样……别管了。伊阿普,谢谢你的回答。我的实现中缺少的是“self”(在self.tableView中),您的回答帮助我澄清了这一点。感谢Nekto的回答,这对我很有帮助。
NSIndexPath * someRowAtIndexPath = [NSIndexPath indexPathForRow:3 inSection:4];
[tableView scrollToRowAtIndexPath:someRowAtIndexPath atScrollPosition:UITableViewScrollPositionBottom animated:YES];
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathWithIndex:1] atScrollPosition: UITableViewScrollPositionNone animated:NO];