Lennart P.
Lennart P.

Reputation: 376

improving the quality of view after adding a shadow to it

I've added a dropshadow to a view in my tableview cell but all the content of that cell has now really bad quality

Here's the code I've used to create the shadow:

    shadowView.layer.shadowColor = UIColor.black.cgColor
    shadowView.layer.shadowOpacity = 0.2
    shadowView.layer.shadowOffset = CGSize.zero
    shadowView.layer.shadowRadius = 4
    shadowView.layer.shouldRasterize = true

Here's an image

Does anybody know how to fix this?

Thank you very much, I appreciate any kind of help

Upvotes: 0

Views: 56

Answers (1)

Lennart P.
Lennart P.

Reputation: 376

I realized what I did wrong:

I accidentally set the shouldRasterize property to true instead of false.

Maybe this helps someone else too

Upvotes: 1

Related Questions