Quantcast
Channel: Change Default Scrolling Behavior of UITableView Section Header - Stack Overflow
Viewing all articles
Browse latest Browse all 20

Answer by LocoMike for Change Default Scrolling Behavior of UITableView Section Header

$
0
0

I know it comes late, but I have found the definitive solution!

What you want to do is if you have 10 sections, let the dataSource return 20. Use even numbers for section headers, and odd numbers for section content. something like this

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {    if (section%2 == 0) {        return 0;    }else {        return 5;    }}-(NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {    if (section%2 == 0) {        return [NSString stringWithFormat:@"%i", section+1];    }else {        return nil;    }}

Voilá! :D


Viewing all articles
Browse latest Browse all 20

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>