2011-04-03 74 views

回答

1

我会用UITableView上的下列方法滚动到正确的索引路径: - (void)scrollToRowAtIndexPath:(NSIndexPath *)indexPath atScrollPosition:(UITableViewScrollPosition)scrollPosition animated:(BOOL)animated

NSIndexPath上使用+ (NSIndexPath *)indexPathForRow:(NSUInteger)row inSection:(NSUInteger)section方法,通过将行设置为0并将段从0运行到可从数据源请求的段总数来生成每段开始的索引路径。

+0

其实是的,这是死的简单。返回-1到tableView:sectionForSectionIndexTitle:atIndex:并在相关索引上执行scrollToRowAtIndexPath可以很好地完成这项工作。 – ssteinberg 2011-04-03 16:30:38