100字范文,内容丰富有趣,生活中的好帮手!
100字范文 > UI自定义UITableView的右侧索引

UI自定义UITableView的右侧索引

时间:2022-12-14 09:06:51

相关推荐

UI自定义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);

}

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。