iOS Grouped UITableView with transparent background
- April 11th, 2011
- Posted in Tech Bits
- Write comment
While developing one of the iOS apps for Martian Storm I found a bug in the Interface Builder which is present in Xcode 3 and 4. In Interface Builder if you create a view containing a UITableView, change the style to Grouped and set the background to clear you end up with black corners.

The solution is to set the table background to clearColor in code.
Add a UITableView outlet to your UIViewController's interface:-
IBOutlet UITableView *infoTable;
In Interface Builder open up your UIViewController's .xib file and connect the outlet defined above to the UITableView.
add the following to your UIViewController's initWithNibName implementation:
infoTable.backgroundColor = [UIColor clearColor];

Thanks for the explanation. Nice work!