[英]UITableView Section Index doesn't respond
我有一个已启用部分索引的表视图。 所有索引均显示正确,但是我无法使搜索图标真正响应。 使用右侧的区域索引滚动条后,左侧的图片显示的表格与表格的滚动程度一样高,但应使用右侧的设计显示。 任何帮助将非常感激!!
在这种情况下,我总是对搜索栏进行自定义滚动,并从委托方法中返回-1。
我的tableView:sectionForSectionIndexTitle:atIndex:看起来像这样-不确定是否有更好的方法:
- (NSInteger)tableView:(UITableView *)tv sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
NSInteger section = -1;
if ([title isEqualToString:UITableViewIndexSearch]) {
CGRect searchBarFrame = self.searchDisplayController.searchBar.frame;
[tv scrollRectToVisible:searchBarFrame animated:NO];
}
else {
section = whatever logic you use to determine section
}
return section;
}
顺便说一句,这是使用searchDisplayController属性。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.