Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UISplitViewController Detail View Drop shadow

I'm trying to set a shadow on my UISplitViewController's Detail View, that I want to be visible over the Master View, in iOS 6.

In my Detail ViewController:

 self.view.layer.shadowColor = [[UIColor blackColor] CGColor];
 self.view.layer.shadowOffset = CGSizeMake(-3.0f, 0.0f);
 self.view.layer.shadowRadius = 3.0f;
 self.view.layer.shadowOpacity = 1.0f;
 self.view.layer.masksToBounds = NO;
 self.view.clipsToBounds = NO;

However, the SplitVC automatically clips its sub-views, even when I set it to NO in the above code, and there is no shadow.

Can anyone let me know the correct way to achieve this?

like image 672
Arvindh Avatar asked Nov 13 '22 20:11

Arvindh


1 Answers

The best way I found to do this is to add a 1px view to the master view controller and snap it to the right edge and apply a shadow to that view instead.

like image 86
Travis M. Avatar answered Jan 04 '23 02:01

Travis M.