自定义UITableView的右侧索引


// 右边索引的标题数组
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
NSMutableArray *array = [NSMutableArray array];
for(int section='A';section<='Z';section++)
{
[array addObject:[NSString stringWithFormat:@"%c",section]];
}
return array;
}
// 自定义索引与数组的对应关系
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
return (index+1==26)?0:(index+1);
}


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM