alt text http://img179.imageshack.us/img179/2047/iphonetableview.png
I have a UITableView within a nib file. It works perfectly with 4 or more cells. When I have only 2 or 3 cells and the screen is not completely filled with cells I have these empty cells (dark gray, which is actually just the background of my TableView) at the bottom.
However, they shouldn't be there, because my numberOfSectionsInTableView
and numberOfRowsInSection
returns the correct values.
Any ideas?
What you see is the default behaviour of UITableViewStylePlain. If you don't want to have "empty cells" below your real cells, move the "More" button (seen in your pic) into UITableView tableFooterView. When you don't have "More" button and still don't want "empty cells", create an empty footer:
self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectZero];
For some reason existance of tableFooterView removes "empty cells" after the real cells.
I don't think they are actually cells. You are seeing the white lines because this is the default behavior for the table view. Have you tried changing the separator for the table view to none in IB?
alt text http://img.skitch.com/20100513-x5428pkyp8iaqchmkrd41h8m98.png
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With