I'm having trouble making my UINavigationBar completely transparent with only the white text & buttons to be shown on it, so that the ImageView I use for ViewController background is completely visible at the top.
I've tried this code amongst other:
// Set the BarTintColor to translucent and text colors to white
self.navigationController.navigationBar.barTintColor = [UIColor clearColor];
self.navigationController.navigationBar.titleTextAttributes = [NSDictionary dictionaryWithObject:[UIColor whiteColor] forKey:UITextAttributeTextColor];
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
But this is the result, a blackish UINavigationBar, how can I solve this?
The app pushes over from this ViewController to this ViewController where the UINavigationBar fades over to red. There are several other ViewControllers doing the same fade animation, so the UINavigationBar is required
The part of the first ViewController with the "Ny" button will be improved;) - just working on getting my hands on a tool like Photoshop
Thanks! Erik
You need to do three things to make a navigation bar transparent. Set background image to non-nil empty image ( UIImage() ). Set shadow image to non-nil empty image ( UIImage() ). Set isTranslucent to true .
A Boolean value that indicates whether the navigation bar is translucent.
The navigation item used to represent the view controller in a parent's navigation bar.
I was able to get the nav bar transparency using the #AARRGGBB pattern specified in the docs.
This is what I use to make the navigation bar transparent:
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.translucent = YES;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With