Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS7 - Change UINavigationBar border color

Is it possible to change the grey border-bottom color of the UINavigationBar in iOS7?

I already tried to remove to border, but this is not working:

[[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]]; 

Thanks!

like image 377
MappleDev Avatar asked Sep 30 '13 18:09

MappleDev


1 Answers

You are removing the shadow but not the border, you need to do the following:

[[UINavigationBar appearance] setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault]; [[UINavigationBar appearance] setShadowImage:[[UIImage alloc] init]]; 

To change the border use an image of 2 pixels width line:

[[UINavigationBar appearance] setShadowImage:[UIImage imageNamed:@"2pxWidthLineImage"]];  
like image 194
Tarek Hallak Avatar answered Sep 20 '22 19:09

Tarek Hallak