Alex Rivera | Logout

Transparent background in grouped UITableView - iPhone

Asked 2010-03-07T12:41:15.243
22

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

Edit
Report

1 Answer

3

I had this issue and found that there was no difference between using:

[[UIColor alloc] initWithWhite:1 alpha:0.0];

and using:

[UIColor clearColor];

I tried both of these and still had the little black corners on my table view.

I also tried setting the backgroundView to nil as suggested, but this didn't work either.

I solved this by setting the backgrounds of the individual cells to transparent in the cellForRowAtIndexPath method:

cell.backgroundColor =  [UIColor clearColor];

Of course, this has the side effect that your cells themselves are transparent, which isn't ideal for everyone, but it ok for me in this case.

answered 2012-06-27T10:22:06.170

Your Answer