UITableView hide sectionindex but keep sections

We would like to implement our own partition index interface for a UITableView.

This is clear because the contact application does this on the iPad. Is there a way to legally hide the current partition index? (I can get to the undocumented Uindiew _index, but I'm not going to shorten it with Apple, I suspect)

+4
source share
2 answers

This answer helps.

The trick here is to have

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

return nil, while maintaining implementations of other partition-based data source methods:

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

This is similar to the fact that tableview does not display the partition index, but still allows index navigation.

+13
source
+1
source

Source: https://habr.com/ru/post/1306066/


All Articles