在iPad的iOS7上,首先,我设置了一个模态视图控制器,大小为320*460,然后,在这个模态视图控制器中,我提出了另一个导航视图控制器,在此之后,导航栏和工具栏的色调颜色呈现的导航控制器变灰.我试图设置导航栏和工具栏的色调,但它不起作用.
然后我尝试直接呈现导航控制器,然后所有色调颜色都在导航栏和工具栏上工作.
我试过barTintColor导航栏和工具栏的属性,它的工作原理.
我不知道会发生什么.
更新
首先,我定义一个视图控制器:modalViewController现在的模态视图控制器如下:
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];
Run Code Online (Sandbox Code Playgroud)
其次,定义导航视图控制器:navigationController如下所示呈现导航控制器:
if (DeviceIsPad())
navigationController.modalPresentationStyle = UIModalPresentationCurrentContext;
// here self means the modalViewController mentioned above
[self presentViewController:navigationController animated:YES completion:nil];
Run Code Online (Sandbox Code Playgroud)
我在navigationController的'viewDidLoad'方法中设置导航栏和工具栏栏项.
默认情况下,当导航视图控制器出来的时候,所有的工具栏按钮的项目(这些项目是与像只是基本的标题建Cancel,OK)变成灰色.
与此同时,我已经尝试设置tintColor的tool bar和navigation bar.使用实例方法和外观方法(如[[UIToolBar appearance] setTintColor:[UIColor blueColor]]).但它仍然无效.
然后我尝试直接从普通视图控制器呈现navigationViewController上面提到的 …