Everything is in the Title.
I have a UITableView with cells. The cells has a Shadow (self.layer.shadow...).
The problem is that the shadow of one cell is Overlapping the cell above. How can I prevent this behavior ?
And here is the code in my cell :
self.layer.shadowColor = UIColor.gray.cgColor
self.layer.shadowOffset = .zero
self.layer.shadowOpacity = 0.15
self.layer.shadowRadius = 10
self.layer.cornerRadius = 8
backgroundColor = .white
Use this code for adding shadow :-
self.layer.masksToBounds = false
self.layer.shadowOffset = CGSize(width: -1, height: 1)
self.layer.shadowOpacity = 0.2
self.layer.cornerRadius = 8
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