简体   繁体   English

为“更多”标签更改NavigationBar的颜色?

[英]Change color of NavigationBar for the “More” tab?

When you have more than 5 view controller in your TabBarController, a "More" view is automatically setup for you. 如果TabBarController中有超过5个视图控制器,则会自动为您设置“更多”视图。 Is it possible to change color of the navigationBar in this view to match the color I am using, instead of the default blue? 是否可以在此视图中更改navigationBar的颜色以匹配我使用的颜色,而不是默认的蓝色?

OK. 好。 I should not have trusted the docs completely. 我不应该完全相信文档。 I found the answer a couple of minutes later by trying it out. 几分钟后我通过尝试找到了答案。 The docs lists the moreNavigationController is a read-only property. docs列出了moreNavigationController是一个只读属性。 But this works fine for me: 但这对我来说很好:

tabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;

or 要么

tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor redColor];

In case anyone was wondering. 如果有人想知道。

在您的应用程序中, UIApplicationDelegate将此:

self.tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor blackcolor];

I only know that this works: 我只知道这有效:

yournavigationController.navigationBar.tintColor = [UIColor blueColor];

But I do not know if it works therfore. 但我不知道它是否有效。

putting

tabBarController.moreNavigationController.navigationBar.tintColor = [UIColor colorWithRed:64/256.0 green:191/256.0 blue:23/256.0 alpha:1.0];

in my main app delegate worked 在我的主应用代表工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM