tags:

views:

167

answers:

3

I've tried setting the style of the UINavigationbar to be a translucent style in the viewDidLoad method of my controller. But nothing is changed. Why?

I set the property using the standard code like

self.navigationController.navigationBar.barStyle = UIBarStyleBlackTranslucent;
+1  A: 

According to Apple documentation:

UIBarStyleBlackTranslucent is deprecated. Use UIBarStyleBlack and set the translucent property to YES instead.

Alexey Korobko
A: 

just had the same issue - the apple doc is a little vague - here's the solution

navigationController.navigationBar.barStyle = UIBarStyleBlack;

navigationContoller.navigationBar.translucent = YES;

Paul
just noting your code above, you need to add it as a subview (usually to the "parent" view) also, you may not want to hold it as an instance variable as it gets added it as a subview in which it will get autoreleased.
Paul
A: 
UIBarStyleBlackTranslucent
Deprecated. Use UIBarStyleBlack and set the translucent property to YES instead.
Available in iPhone OS 2.0 and later.
Declared in UIInterface.h.
Manjunath