Would like to know create drop shadow for UINavigationbar. I tried to create custom navigation bar background with drop shadow, but the drop shadow cover the background view
In applyDefaultStyle
, try adding this line:
self.layer.masksToBounds = NO;
The default value for this property is YES
, which means that even though the shadow is rendered, it won't be rendered outside the bounds of the view, which means effectively that you don't see it at all.
If you're animating this view in any way, you should also add this line:
self.layer.shouldRasterize = YES;
... unless you want the animation to be slow and jerky.