Weird problem: After rotating my app to portrait, picking the toolbar item and exposing the uipopovercontroller, if I rotate back to landscape, the UINavigationController on the right side (objectAtIndex:0 of the SplitView) changes the color of the navigation bar. I am not sure why. I have it set in Interface Builder to be barStyle = UIBarStyleBlackOpaque;
It turns silver after it returns to landscape mode.
This only happens if I rotate it to portrait, create the popover, and select something in the navigation controller, which pushes another tableViewController. Even setting the properties in the viewDidLoad method does nothing.
Anyone have an idea?
You can use a separate class for changing color, make the background color that class , your desired color, and then use that class as class of your rootViewController. I did, it works.
Filed a bug report about this weeks ago and Apple said that this is a known bug of 4.2. I then asked if there was a way to fix this, but no reply so far.
It's also no use replacing the UINavigationbar with a subclassed/customized navigation bar. The popover seems to perform some secret nasty stuff on the UINavigatioBar which kills the tintColor and won't allow to reset it (it'll always remain 'nil', even after resetting it).
I basically gave up and told the customer he'll have to live with it until the next update is out (hopefully).
Cool, fixed it.
Added to my RootViewController where the splitviewcontroller and nav bar is declared:
Yuo have to create a class method (setLand:int i) on RootViewController called from detailviewcontroller in these method:
and
and on RootViewController:
and finaly alway in RootViewController
..this works well in my app, editing custom landscape/portrait navigationBar
There seems to be an issue with 4.2 and setting the tintColor of the navigationBar after rotation. You can set the barStyle correctly using the answers above, but not the tintColor. Anybody else having the same issue?
This problem is fixed used the following code