Newbie Questions Newbie Questions - 2 months ago 11
iOS Question

How to add a shadow effect for UINavigation bar?

Do you have to add it programmatically? Or there is an option from the main.storyboard interface builder?and if there is a way from storyboard , How do you add it ?

Something like this :
Example

Thanks

Answer

You would have to add it programatically.

Do this in your UINavigationController Class

self.navigationBar.shadowColor = UIColor.blackColor().CGColor
self.navigationBar.shadowOffset = CGSizeMake(5, 5)
self.navigationBar.shadowRadius = 5
Comments