开发者

Strange issue with Indexed UITableView's section index title is incorrect

开发者 https://www.devze.com 2022-12-08 18:23 出处:网络
I ran into a strange issue with my indexed tableview\'s section index titles.The index titles returned is correct (A - Z) as outputted by the debugging code below but the displayed index titles on the

I ran into a strange issue with my indexed tableview's section index titles. The index titles returned is correct (A - Z) as outputted by the debugging code below but the displayed index titles on the right side of the table is separated with • instead. So instead of A B C D... I 开发者_StackOverflow社区get A • C • E •... instead.

Any idea what's causing this? I have another tableview in my app but that tableview doesn't suffer from this problem but I haven't figured out why yet.

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {

 NSMutableArray *sectionTitles = [[[NSMutableArray alloc] init] autorelease];
 [sectionTitles addObject:UITableViewIndexSearch];
 [sectionTitles addObjectsFromArray:[self.fetchedResultsController sectionIndexTitles]];

        // NSArray *debug = [self.fetchedResultsController sectionIndexTitles];
        // CFShow(debug);
 return sectionTitles;
}


This is caused when the height available to display the index is less than what is needed to display each letter. The index is abbreviated (or shrunk). This effect will also occur when the keyboard is displayed and the index is still visible.

0

精彩评论

暂无评论...
验证码 换一张
取 消