Detailed view UISplitViewController Drop shadow

I am trying to set the shadow in my detail view of the UISplitViewController that I want to see in the main 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, SplitVC will automatically copy its subviews even when I set it to NO in the above code, and there is no shadow.

Can someone tell me the correct way to achieve this?

+4
source share
2 answers

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

+1
source

It seems that the supervisor is somehow cropping down the hierarchy.

Try the following:

 UIView *v = self.view; do { v.clipsToBounds = NO; v = v.superview; } while(v != nil); 

Remember that this will result in clipping for all views in the hierarchy! - It may be more than you asked :-).

0
source

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


All Articles