views:

36

answers:

2

In my iPad app, I have the barStyle property set to UIBarStyleBlack by this code:

// in viewDidLoad
self.navigationController.toolbar.barStyle = UIBarStyleBlack;

Strangely, when I rotate my iPad, the barStyle will sometimes reset to the gray / grey color. Any ideas on why this might be happening?

A: 

This seems to be the same as this question, which has an accepted answer that seems to me like it would work.

The information provided in that question help me understand the problem. On rotation, different view controllers are being hidden and shown, and potentially, their properties deallocated. The answer's author suggests using the delegate callbacks from UISplitViewController to find out when to re-set your bar style, not the standard UIView callbacks:

http://developer.apple.com/library/ios/#documentation/uikit/reference/UISplitViewControllerDelegate_protocol/Reference/Reference.html#//apple_ref/doc/uid/TP40009454

phooze