iOS 9显示iPad上导航栏按钮的色调不正确



代码:

    UINavigationBar.appearance().barStyle = UIBarStyle.Black
    UINavigationBar.appearance().barTintColor = UIColor.pantone320C() // bar color
    UINavigationBar.appearance().tintColor = UIColor.whiteColor() // button color
    UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName: UIColor.whiteColor()] // text color

它在iPad Air iOS 9.0:上的外观

https://drive.google.com/file/d/0B25vGgRxmgU_dXdhdk5FYURiTmc/view?usp=sharing

我在iPhone 6 iOS 9、iPhone 5 iOS 8.0和;8.4,iPad 3 iOS 8.4,它们都显示了正确的白色色调。

知道为什么会发生这种事吗?

感谢

所以我遇到了同样的问题,因为IOS9和iPad只是在某些项目上不尊重色调。踢开包含我受影响项目的视图有帮助。尽管我正在将其更改为当前的值。

    -(void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
        [self.view viewWithTag:99699].tintColor = nil;
        [self.view viewWithTag:99699].tintColor = [UIColor redColor];
    });
}

在我的例子中,我有一个位于视图控制器内的UIButtons,它位于UIPopOverController内的UINavigationController内。通过查看视图调试器,我可以看到按钮错误地解析了tintColor。tintColor是可检测的特性之一。

我可以设置按钮的色调并清除它,也可以按照上面的操作。除非我推迟更改,否则更改不会起作用。

所以对你来说,你可以试着摆弄代理或导航栏的色调。

最新更新