Reputation: 301
i'm developping my first app on iOS 7 and facing a new problem.
What i want to do is to have a my UINavigationBar translucent AND colored,
how can i managed this ?
self.navigationController.navigationBarHidden = YES;
self.navigationController.navigationBar.translucent = YES;
self.navigationController.navigationBar.barTintColor = [UIColot greenColor];
if i set the bartintcolor the translucent property is no more valid.
I know there is a lot of questions about that but beileve me i have searched a lot and could'nt find a working solution.
thanks for all.
Upvotes: 2
Views: 3080
Reputation: 1545
You could try this from the Apple docs: https://developer.apple.com/library/ios/samplecode/NavBar/Listings/CustomAppearance_CustomAppearanceViewController_m.html
See the applyTransparentBackgroundToTheNavigationBar
method. That got me started.
Upvotes: 1
Reputation: 1392
Theoretically,
self.navigationController.navigationBar.barTintColor = [UIColor greenColor];
is all you need.
Maybe change the alpha value to see if it's just not apparent enough?
Try
self.navigationController.navigationBar.barTintColor = [UIColor colorWithRed:0.0/255.0 green:255.0/255.0 blue:0.0/255.0 alpha:0.6];
Upvotes: 0
Reputation: 4703
Create a partially transparent image with the color you want the navigation bar to be and use that image as the navigation bar's background image.
Upvotes: 1