在 iPhone 音乐应用中,选择 Artist、Songs 或 Albums 会在 UI 右侧显示一个 tableView,其中包含单个字母的垂直列表,可以快速滚动。如何在我的应用中启用此功能?
干杯, 道格
最佳答案
提供您自己的索引字符:
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
return[NSArray arrayWithObjects:@"a", @"e", @"i", @"m", @"p", nil];
}
然后:
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString
*)title atIndex:(NSInteger)index {
return <yourSectionIndexForTheSectionForSectionIndexTitle >;
}
您将需要部分。
关于ios - iPhone UITableView。如何开启音乐 App 之类的单字母字母列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1655119/