6

I have a UIView mainView, I've added 4 buttons in each corners as subviews. I added 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 show shadows (the buttons) too. How to hide subviews shadows. Thanks in advance.

Vervatovskis
  • 2,277
  • 5
  • 29
  • 46

1 Answers1

1

I have also fetch the same problem and found the solution of this issue.

  • just set the background color for super view (Replace super view's background clear to any other color.)

EX: In above Questions

mainView.backgroundColor = UIColor.white

kuldip bhalodiya
  • 992
  • 7
  • 11