I'm trying to implement the following card style in my app, and I'm having an issue with the shadow element for each card.
The shadow of a cell is not displayed behind the cell directly below it.
UITableView is used, and cell background is set to transparent.
I suspect the shadow cut-off is caused by the cell's height. I don't want to increase the space between each 'card', so increasing the cell's height is not a good option.
So you might possibly be able to solve it by setting each cell's clipsToBounds to false and/or their layer's masksToBounds to false. I doubt it'll work, but is worth a try.
What I suspect you'll need to do is specify the cells as transparent, then place a view within them that is not as high as the cell, to leave room for that view's shadow. So the view looks like a card with shadow, and is offset within the transparent cell so that the card + shadow fits perfectly within the cell.
Try to set the cell's backgroundColor to clearColor.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With