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

后端 未结 9 928
再見小時候
再見小時候 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条回答
  •  猫巷女王i
    2020-12-02 05:05

    If you're using MonoTouch, override the SectionIndexTitles(UITableView) method in the UITableViewDataSource class. Just return an array of strings and the subclass takes care of the rest.

    class TableViewDataSource : UITableViewDataSource
    {
      public override string[] SectionIndexTitles(UITableView tableView) 
      { 
        return new string[] { /*your string values */};
      }
    }
    

    *just a hint for those of us using C# and Mono (.NET) to write iPhone apps. :)

提交回复
热议问题