iPhone UITableView. How do turn on the single letter alphabetical list like the Music App?

后端 未结 9 904
再見小時候
再見小時候 2020-12-02 04:25

In the iPhone music app, selecting Artist, Songs, or Albums presents a tableView with a verticl list of single letters at the righthand side of the UI that enables rapid scr

9条回答
  •  自闭症患者
    2020-12-02 05:24

    Supply your own index characters:

    - (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
        return[NSArray arrayWithObjects:@"a", @"e", @"i", @"m", @"p", nil];
    }
    

    and then:

    - (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString
        *)title atIndex:(NSInteger)index {
            return ;
    }
    

    You will need sections.

提交回复
热议问题