1

I tried to apply a shadow to an uiView inside a containerView. The problem is that the shadow at the top gets cut by the boundaries of the containerView. Here you can see my view hierarchy:

> containerView
    > pageViewController
        > scrollView
            > view
                > view !!! → the shadow was here applied

It looks like this:

cutted shadow by the containerView

I tried to apply layer.masksToBounds to several superViews of my "shadowView" but nothing helped...

Has anyone a solution?

Thank you in advance!

With best regards Tom

  • 2
    containerView.clipsToBounds = false –  Feb 19 '17 at 18:16
  • Possible duplicate of [Shadow UIview and clipsToBounds](http://stackoverflow.com/questions/23760918/shadow-uiview-and-clipstobounds) –  Feb 19 '17 at 18:20
  • @Sneak I tried both, clipsToBounds = false and masksToBounds = false. Sadly nothing has changed... – Tom Kuschka Feb 23 '17 at 14:22
  • 1
    You have a massive chain of views inside the containerView. You need to set every one of them to false. Otherwise somewhere in the chain, it wil get clipped. Same with your pageViewController.view –  Feb 23 '17 at 19:39

0 Answers0