views:

28

answers:

1

Hi

I'm trying to add a shadow to a uitabelviewcell using the layer.shadowColor, Offset, Radius but it doesn't seem to affect it in anyway. The table is grouped style. Any ideas why?

Here is the code i'm using:

cell.layer.shadowColor= [UIColor blackColor].CGColor;
cell.layer.shadowRadius = 5.0;
cell.layer.shadowOffset = CGSizeMake(10, 10);
A: 

The view hierarchy of a grouped table view cell is really rather opaque. cell.layer is actually referring to the layer of the main view of the cell, which takes of the entire width of the table. The rounded part of the cell that is inset is actually handled by apple's private methods for drawing grouped cells.

You're probably going to have more luck creating a custom subclass of UITableViewCell.

Jerry Jones