【发布时间】:2015-11-04 10:08:21
【问题描述】:
我想通过点击UITableView 旁边的sectionIndexTitles 来允许滚动浏览我的UITableView。到目前为止,我的解决方案如下:
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
NSIndexPath *matchingIndexPathForTitle = [self matchingIndexPathForSectionIndexTitle:title];
if (matchingIndexPathForTitle) {
[tableView scrollToRowAtIndexPath:matchingIndexPathForTitle
atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
return 1;
}
但似乎从iOS9开始它总是滚动到UITableView的顶部
我可以保证 matchingIndexPathForTitle 是正确的(例如,第 1 节,第 22 行)并且更改为 animated:NO 并没有什么不同。
你有吗
- 对这种奇怪的行为有解释吗?或
- 对如何实现 iOS 9 的快速滚动有什么建议吗?
【问题讨论】:
标签: ios objective-c iphone uitableview uiscrollview