views:

1022

answers:

4

Hello,

If you have a plain (not grouped) UITableView with a single row, the rest of the screen is filled with blank or empty cells. How do you change the appearance of these blank cells? Af first, I thought they would have the appearance of the cell used in the table view but it seems they don't.

The people from Cultured Code (Things) have done a nice job modifying these cells but I can't immediately think of a way to change their appearance.

Any tips?

A: 

You will probably have to make a custom subclass of UITableView that fills the background with the appearance of blank cells.

- (void)drawRect:(CGRect)rect {
  [super drawRect: rect];

  // draw your background here if the rect intersects with the background area
}
Daniel
+3  A: 

Although it's not quite what you're looking for, you can also change it to just display a blank region (instead of blank cells) by setting a footer view on the table. A UIView of height 0 will do the trick.

dmercredi
With your help, I figured it out and it is quite simple. Add the desired UIImageView to the footer of the UITableView (as you suggested) but to have the table view behave correctly you have to increase its height with the height of the UIImageView. This way, the table view will behave as a normal table view but you have the nice effect I was looking for. Be sure to remove the cell separators of the table view.
bare_nature
A: 

Just clear the background of UITableView:

tableView.backgroundColor = [UIColor clear];
borut-t