开发者

Removing SectionIndex dynamically

I am using sectionIndexTit开发者_运维百科lesForTableView to display index in a UITableView. It is working fine but I am using the same TableView to display something where I do not need this index. So, the question is how to remove the sectionIndex?


Use a BOOL value to track which display you are using (the first or the second) and do something like this (isDisplayingFirst is a boolean):

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
   if (isDisplayingFirst) {
      // return your section index titles
   } 
   return nil; // otherwise return nothing
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜