views:

29

answers:

2

Hi everybody, I'm trying to get a semi-transparent uitableview, with this color

[UIColor colorWithRed:(247.0/255.) green:(151.0/255.0) blue:(121.0/255.0) alpha:0.38];

It's ok if there are only empty cells, but when a cell has content inside, the background turns more solid. It's as if the cell itself had the same table background, so that transparency is multiplied. You can get what I mean looking at the following screenshot http://yfrog.com/nfsemitransparencyp.

The cells with content inside are semi-transparent, but with a wrong alpha.

The table background is set correctly

self.myTable.backgroundColor = bgcolor;

The background of the cell is set to clear and not opaque

self.contentView.backgroundColor = [UIColor clearColor];
self.contentView.opaque = NO;

So, why does it has this behavior? Can someone help me?

A: 

It's probably caused by the caching of the cell. Have you tried disabling the cache? It's very inefficient ofcourse, but it might help you find a solution for this issue, if it's indeed the UITableViewCell cache is the problem.

You can disable it by not using the "dequeueReusableCell" function in your tableView:cellForRowAtIndexPath: function.

Wolfgang Schreurs
Thanks for your answer, but even disabling cache didn't solve the problem.
notme
A: 

I solved using a transparent UITableView and putting a semi-transparent UIView behind it.

notme