代码之家  ›  专栏  ›  技术社区  ›  Boon

索引UITableView的节索引标题有一个奇怪的问题不正确

  •  2
  • Boon  · 技术社区  · 15 年前

    我的索引表视图的节索引标题遇到了一个奇怪的问题。返回的索引标题是正确的(A-Z),由下面的调试代码输出,但表右侧显示的索引标题用分隔。因此,不是B C D。。。我得到一张C。。。相反

    - (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;
    }
    
    1 回复  |  直到 15 年前
        1
  •  2
  •   Thomas Eding    15 年前

    当可用于显示索引的高度小于显示每个字母所需的高度时,就会出现这种情况。索引被缩写(或收缩)。当显示键盘且索引仍然可见时,也会出现此效果。