Cocoa-Matic

iPhone, iPod touch, iPad tutorials, examples and sample code. Come and get it!

Friday, August 13, 2010

Unwanted UITableView gray background on iPad

I came across something weird when developing an iPad app. I have a UITableView that does not encompass the entire screen and I have it set to grouping mode so it has nice looking rounded corners. For some reason when this is displayed, the background of the UITableView is light gray. It seems to be ignoring the backgroundColor property.

So, here's the fix:

Set the backgroundView to nil.
if ([self.tableView respondsToSelector:@selector(backgroundView)]) {
     self.tableView.backgroundView = nil;
}
Note, it's always a good idea to make sure the object responds to the selector, so that's what the check is all about.

Labels: , , ,

1 Comments:

Post a Comment

Subscribe to Post Comments [Atom]



<< Home


« Older Entries  
Newer Entries »