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!
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!
This will help you :)
You are removing the shadow but not the border, you need to do the following:
To change the border use an image of 2 pixels width line:
The only way I found to change color is:
Well, if you want to remove bottom border you set shadow image to empty image
so if you want to set it to another color just create image with that color, I use a helper function to create image from color below (original source http://jslim.net/blog/2014/05/05/ios-customize-uitabbar-appearance/)
and in my navbar
that's it, It's working for me, hope this help. Please consider changing the accepted answer because its not working and can be confusing
Based on the answer from @sash I made an extension in Swift using Autolayout, explained right here.
In essence, the other solutions have the following pitfalls:
This let you still add a drop shadow if you need to, and this handles rotation nicely !
To build on @sash's Swift implementation you can make the border responsive to rotation/trait changes by using constraints: