Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to add an image in the navigation bar

I want to add an image in the navigation bar. It should be throughout my app. It should be added to all navigation controllers.

Any help will be appreciated.

like image 402
Dhruv Avatar asked Dec 21 '22 05:12

Dhruv


1 Answers

Try this ,

UINavigationBar *navBar = self.navigationController.navigationBar;
UIImage *image = [UIImage imageNamed:@"image.png"];
[navBar setBackgroundImage:image forBarMetrics:UIBarMetricsDefault];
like image 92
pratik bhiyani Avatar answered Dec 24 '22 09:12

pratik bhiyani