简体   繁体   中英

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. Is it possible to change color of the navigationBar in this view to match the color I am using, instead of the default blue?

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. 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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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