Tableview添加索引
来源:互联网 发布:小学生网络教学 编辑:程序博客网 时间:2024/06/08 11:49
//添加索引栏标题数组- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{ NSMutableArray *resultArray =[NSMutableArray arrayWithObject:UITableViewIndexSearch]; for (NSString *str in [[self.vpnCityListArr[0] allKeys] sortedArrayUsingComparator:^NSComparisonResult(NSString *str1, NSString *str2){ return [str1 compare:str2]; }]) { [resultArray addObject:str]; } NSLog(@"索引:%@",resultArray); return resultArray; }//点击索引栏标题时执行- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index{ //这里是为了指定索引index对应的是哪个section的,默认的话直接返回index就好。其他需要定制的就针对性处理 if ([title isEqualToString:UITableViewIndexSearch]) { [tableView setContentOffset:CGPointZero animated:NO];//tabview移至顶部 return NSNotFound; } else { return [[UILocalizedIndexedCollation currentCollation] sectionForSectionIndexTitleAtIndex:index] - 1; // -1 添加了搜索标识 } }
阅读全文
0 0
- TableView索引的添加
- Tableview添加索引
- iOS UITableView(九) 给tableView添加索引
- ios tableView那些事 (十三) 给 tableview 添加索引
- ios tableView那些事 (十三) 给 tableview 添加索引
- iOS tableView 添加索引后 索引遮盖 headview 解决办法
- 修改tableview索引背景
- 自定义的tableView 索引
- tableview的索引值
- tableview加索引
- iOS tableView索引
- tableview 索引条问题
- iOS tableView分区+索引
- tableView侧边栏索引
- tableview索引添加一个显示点击或滑动到哪个字母的控件
- tableview中添加switch
- 给tableView添加一行
- tableview添加删除按钮
- sql转Linq
- Python基础
- C语言基础 递归
- 线程并发四:线程安全之synchronized
- A configuration error occurred during startup.Please verify the preference field with the prompt: To
- Tableview添加索引
- 基于轮廓线索(Contour Cues)的实时行人检测
- 4基于opencv的线性领域滤波(方框_均值_高斯滤波)
- form转json
- java行为设计模式——策略模式
- orcl中查询两个时间的差值(包括时分秒)
- Android引入外部工程作为library,运行主工程报错Manifest merger failed with multiple errors, see ?
- cuda8.0和cudnn v5.1在ubuntu16.04装机
- Android studio 多个so库配置 ffmpeg库配置 cmake编译