UINavigationBar set tintcolor tested in iOS7 not working?

后端 未结 6 1274
攒了一身酷
攒了一身酷 2021-02-07 01:26

I have an app which have a UINavigationBar and I have set the tint color to black like this:

self.navigationController.navigationBar.tintColor = [UI         


        
6条回答
  •  生来不讨喜
    2021-02-07 01:54

        [UINavigationBar appearance].tintColor = [UIColor redColor];
        if ([[UINavigationBar appearance] respondsToSelector:@selector(setBarTintColor:)]) {
            [UINavigationBar appearance].barTintColor   = [UIColor redColor];
        }
    

    //OR

        self.navigationController.navigationBar.tintColor = [UIColor redColor];
        if ([self.navigationController.navigationBar respondsToSelector:@selector(setBarTintColor:)]) {
            self.navigationController.navigationBar.barTintColor    = [UIColor redColor];
        }
    

提交回复
热议问题