Transparent background in grouped UITableView - iPhone

Jacek picture Jacek · Mar 7, 2010 · Viewed 20.4k times · Source

I want to make the grouped UITableView transparent. I partially succeded with the following code:

UIColor *bgColor = [[UIColor alloc] initWithWhite:1 alpha:0.0];
historyTable.backgroundColor = bgColor;

Unfortunately, black corners appeared in the rounded cells. How to get rid of them?

Before After

Answer

Tom Irving picture Tom Irving · Mar 7, 2010

Instead of using

UIColor *bgColor = [[UIColor alloc] initWithWhite:1 alpha:0.0];
historyTable.backgroundColor = bgColor;

Just use:

historyTable.backgroundColor = [UIColor clearColor];

That also clears up the memory leak you were creating.