I am currently working on:
Attached is a screenshot from an iPhone:
This is the code snippet in question:
cell.shadowLayerView.layer.masksToBounds = false
cell.shadowLayerView.layer.shadowOffset = CGSize(width: 0, height: 0)
cell.shadowLayerView.layer.shadowColor = UIColor.black.cgColor
cell.shadowLayerView.layer.shadowOpacity = 0.23
cell.shadowLayerView.layer.shadowRadius = 4
cell.shadowLayerView.layer.shadowPath = UIBezierPath(roundedRect: cell.shadowLayerView.bounds, cornerRadius: 2).cgPath
cell.shadowLayerView.layer.shouldRasterize = true
cell.shadowLayerView.layer.rasterizationScale = UIScreen.main.scale
cell.discriptionLbl.frame.size.width = UIScreen.main.bounds.size.width
In the original tableview XIB image, there is a light gray shadow surrounding all sides (top, bottom, left, right). However, in the captured image, there appears to be extra shadow on the right and bottom sides.
Refer to the Image Below:
Question: How can I replicate the same consistent shadow effect seen in the original image (light gray color) on all sides of the view?
If anyone could provide insight into how to address this issue, I would greatly appreciate it. I have attempted various solutions without success so far.
Thank you in advance for any assistance provided.