Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set background color for UINavigationBar

I want to develop UINavigationBar and also set background color for that. I have created the UINavigationBar but I have problem with setting backgroundcolor. anyone please help me. Thanks.

like image 977
Sugan S Avatar asked Jun 20 '12 07:06

Sugan S


2 Answers

[self.navigationController.navigationBar setBackgroundColor:[UIColor redColor]];

Try like this. I think it will be helpful to you.

Edit: updated the code to actually compile.

like image 174
Prasad G Avatar answered Oct 03 '22 14:10

Prasad G


In the new iOs this it how it works:

self.navigationController.navigationBar.barStyle  = UIBarStyleBlackOpaque;
self.navigationController.navigationBar.barTintColor =[UIColor colorAzulNavegacion];
like image 21
Erusso87 Avatar answered Oct 03 '22 16:10

Erusso87