iPhone UITableViewCell layer shadow

前端 未结 3 1593
忘了有多久
忘了有多久 2020-12-07 19:03

I\'m trying to add a shadow to a UITableViewCell using the layer.shadowColor, Offset, Radius but it doesn\'t seem to affect it in any way. The table is grouped style. Any id

3条回答
  •  一向
    一向 (楼主)
    2020-12-07 19:52

    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.

提交回复
热议问题