Removing shadow from subzones

I have a UIView mainView, I added 4 buttons in each corner as subtitles. I added a shadow to my mainView like this

mainView.layer.shadowColor = [[UIColor blackColor] CGColor]; mainView.view.layer.shadowOffset = CGSizeMake(0,6); mainView.layer.shadowOpacity = 0.3; 

My problem is that subviews also display shadows (buttons). How to hide shadow shadows. Thanks in advance.

+6
source share
1 answer

I also found the same problem and found a solution to this problem.

  • just set the background color for super viewing (replace the super viewing background with any other color.)

EX: In the questions above

mainView.backgroundColor = UIColor.white

0
source

Source: https://habr.com/ru/post/954635/


All Articles