开发者

UITableView hide sectionindex but retain sections

We'd like to implement our own section index UI for UITableView.

It's clearly possible, since the contacts app does it on iPad开发者_运维百科. Is there a way of legally hiding the current section index? (I can get to the undocumented _index UIView but that's not going to cut it with Apple I suspect)


That answer helps.

The trick here is to have

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;

return nil, while keeping implementations for the other section based data source methods:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

That seems to convince the tableview not to display a section index, but still allow navigation by index.


Does the answer to this question help?:

Customizing Section indexes in UITableView in iphone application

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜