UITableView
的部分索引在 iOS 7 上压缩,即使有足够的空间(这发生在 iPad 上)。在 iOS 6 上一切正常:
这只发生在风景中。
UITableView
位于容器 View 内,因为我有一个 UISearchBar
,在 TableView 上方有一个 UISearchDisplayController
,而不是它的标题,但固定在 UINavigationBar
下。
有人知道如何避免 sectionIndexTitles
压缩吗?
最佳答案
在 iOS6 之前,您可以枚举 tableview 的 subview 并修改具有 className UITableViewIndex 的 View 。像这样:
for(UIView *aView in [tableView subviews])
NSLog(@"View:%@",aView);
if([[[aView class] description] isEqualToString:@"UITableViewIndex"])
aView.font=[UIFont fontWithName:@"Helvetica-Bold" size:18.0];
在 iOS7 中,Apple 更改了 View 层次结构并引入了 UITableViewWrapperView 作为 UITableView 的直接 subview ,有效地隐藏了所有实现细节。它没有 subview 。不用再修修补补了。 所以我想唯一剩下的就是将其作为错误归档。
关于ios - 在 iOS 7 上压缩的 UITableView sectionIndexTitles,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19110538/