簡體   English   中英

為“更多”標簽更改NavigationBar的顏色?

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

如果TabBarController中有超過5個視圖控制器,則會自動為您設置“更多”視圖。 是否可以在此視圖中更改navigationBar的顏色以匹配我使用的顏色,而不是默認的藍色?

好。 我不應該完全相信文檔。 幾分鍾后我通過嘗試找到了答案。 docs列出了moreNavigationController是一個只讀屬性。 但這對我來說很好:

tabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque;

要么

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

如果有人想知道。

在您的應用程序中, UIApplicationDelegate將此:

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

我只知道這有效:

yournavigationController.navigationBar.tintColor = [UIColor blueColor];

但我不知道它是否有效。

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

在我的主應用代表工作

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM