On iOS7 of iPad, first, I setup an modal view controller, the size is 320 * 460, then, in this modal view controller, I presented another navigation view controller, after this, the tint color of navigation bar and tool bar of the presented navigation controller turns gray. I have tried to set tint color of navigation bar and tool bar, but it just doesn't work.
Then I tried to present the navigation controller directly, then all tint color works both on navigation bar and tool bar.
I have tried with the barTintColor
property of navigation bar and tool bar, it works.
I don't know what happens.
Update
first, I define a view controller: modalViewController The present the modal view controller like this:
if (DeviceIsPad()) // DeviceIsPad is a method defined somewhere to tell that the device is an iPad.
modaViewController.modalPresentationStyle = UIModalPresentationFormSheet;
//here self is a normal view controller
[self presentViewController:modalViewController animated:YES completion:NULL];
Second, define a navigation view controller: navigationController Present the navigation controller like this:
if (DeviceIsPad())
navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
// here self means the modalViewController mentioned above
[self presentViewController:navigationController animated:YES completion:nil];
I setup the navigation bar and toolbar bar items in 'viewDidLoad' method of navigationController.
By default, when the navigation view controller comes out, all toolbar button items(The items are built with just basic title like Cancel
, OK
) turns to be gray.
At the same time, I have tried to set tintColor
of tool bar
and navigation bar
. Both instance method and appearance method(like [[UIToolBar appearance] setTintColor:[UIColor blueColor]]
) are used. But it still doesn't work.
And then I tried to present the navigationViewController
mentioned above with UIModalPresentationFormSheet
style directly from a normal view controller, then all tintColor for navigation bar and tool bar turns to be the blue color(the system blue color).