UITableView section index overlaps search bar

后端 未结 2 2021
不知归路
不知归路 2020-12-29 11:27

Hi: I want to display a section index in an UITableView with a search bar in the table view header (not section header). But the index strip is now overlapping the search ba

2条回答
  •  盖世英雄少女心
    2020-12-29 12:08

    I add empty strings to indexes array:

    - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
    {
        NSMutableArray *array = [NSMutableArray arrayWithArray:_sortedKeys];
    
        [array insertObject:@"" atIndex:0];
        [array insertObject:@"" atIndex:0];
    
        return array;
    }
    

提交回复
热议问题