Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 257
Newbie Questions Avatar asked Sep 27 '16 09:09

Newbie Questions


1 Answers

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
like image 114
Shayan Jalil Avatar answered Nov 07 '22 11:11

Shayan Jalil