Whats the best way to add a drop shadow to my UIView
I am trying to add a drop shadow to views that are layered on top of one another, the views collapse allowing content in other views to be seen, in this vein i want to keep `view.clipsToBounds` ON so that when the views collapse their content is clipped.

This seems to have made it difficult for me to add a drop shadow to the layers as when i turn `clipsToBounds` ON the shadows are clipped also.

I have been trying to manipulate `view.frame` and `view.bounds` in order to add a drop shadow to the frame but allow the bounds to be large enough to encompass it, however I have had no luck with this.

Here is the code I am using to add a Shadow (this only works with `clipsToBounds` OFF as shown)

    view.clipsToBounds = NO;
    view.layer.shadowColor = [[UIColor blackColor] CGColor];
    view.layer.shadowOffset = CGSizeMake(0,5);
    view.layer.shadowOpacity = 0.5;

Here is a screenshot of the shadow being applied to the top lightest grey layer. Hopefully this gives an idea of how my content will overlap if `clipsToBounds` is OFF.

![Shadow Application.][1]


  [1]: http://i.stack.imgur.com/CeyVz.png

Whats the best way to add a drop shadow to my UIView
===

I am trying to add a drop shadow to views that are layered on top of one another, the views collapse allowing content in other views to be seen, in this vein i want to keep `view.clipsToBounds` ON so that when the views collapse their content is clipped.

This seems to have made it difficult for me to add a drop shadow to the layers as when i turn `clipsToBounds` ON the shadows are clipped also.

I have been trying to manipulate `view.frame` and `view.bounds` in order to add a drop shadow to the frame but allow the bounds to be large enough to encompass it, however I have had no luck with this.

Here is the code I am using to add a Shadow (this only works with `clipsToBounds` OFF as shown)

    view.clipsToBounds = NO;
    view.layer.shadowColor = [[UIColor blackColor] CGColor];
    view.layer.shadowOffset = CGSizeMake(0,5);
    view.layer.shadowOpacity = 0.5;

Here is a screenshot of the shadow being applied to the top lightest grey layer. Hopefully this gives an idea of how my content will overlap if `clipsToBounds` is OFF.

![Shadow Application.][1]


  [1]: http://i.stack.imgur.com/CeyVz.png
