【发布时间】:2014-06-23 12:15:42
【问题描述】:
我有一个集合视图,其中显示了多个人物及其姓名的图像,并且我已经实现了搜索和排序功能。但是,问题是我也想要按字母顺序排列,但是集合视图没有像 UITableView 这样的委托方法。
- (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 >;
}
我也试过这个question,但这会在一个部分中显示集合视图单元格。我不想要多个部分。我只想要部分并实现它的字母滚动功能。
以上方法不在UICollectionViewDelegate方法中。
【问题讨论】:
-
尝试使用排序选择器。这个问题可能会对你有所帮助。 stackoverflow.com/questions/1351182/…
-
我不想排序,就像我提到的那样;我已经实现了排序功能
标签: ios swift uicollectionview