Question

This probably seems like an easy question, but I can't seem to find it. The default behavior of the Table View seems to be to populate blank table cell rows to fill the entire screen even if you have only a few rows populated with labels.

I would like to only show rows that have labels and not when they are blank. So for example if my Table View had only 5 labels, I would like to show only those 5 and not show rows to fill up the screen.

How do I accomplish this in the Storyboard attributes window if possible of via code?

Était-ce utile?

La solution

Set the footer view on the table and it will accomplish what you want.

self.tableView.tableFooterView = [[UIView alloc] init];
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top