2

Is it possible to draw a shadow behind a child view controller using a view's CALayer in iOS 7. I have not worked with the CALayer code before, but have found various examples on the internet and non of them are working. I could be missing a finer point though.

Thanks

2 Answers2

4

I had the same issue with putting a shadow on the child view controller's view. It wouldn't show up until I set the clipsToBounds property to NO. (Apple docs say the default value is NO, but apparently not for child view controllers in my findings)

Albert Tong
  • 411
  • 3
  • 5
0

I figured out what I was doing wrong. There are two things you have to watch out for

1) Make sure the background color of the child view controllers layer is not transparent 2) Make sure the child view controller you want to add a background shadow on is added after the child view controllers you want to shadow.