1

我已将这段代码放在我的applicationDidFinishLaunching方法中,以获得黑色的导航栏。带有黑色背景条的TabBarController NavigationController

rootTabBarController.navigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 
rootTabBarController.moreNavigationController.navigationBar.barStyle = UIBarStyleBlackOpaque; 

其工作正常,但是当用户重新安排在编辑模式下的图标,我得到一个默认的蓝色导航栏。

任何人都可以帮助我狂热蓝色导航栏吗?

btw:非常感谢天才群众!

+0

尝试加入您的代码为 - (void)viewWillAppear代替。 – Jordan 2010-05-17 00:36:49

+0

我在我的applicationDidFinishLaunching方法中有 – 2010-05-17 00:45:04

+0

还没有人? – 2010-08-03 22:07:43

回答

1

最后我有一个解决方案,THX到AAA4从苹果论坛

实现应用程序委托类以下的委托方法: 请确保您已设置的UITabBarController

的代表
- (void)tabBarController:(UITabBarController *)controller willBeginCustomizingViewControllers:(NSArray *)viewControllers { 
UIView *editView = [controller.view.subviews objectAtIndex:1]; 

// change backgroundColor of Edit View 
editView.backgroundColor = [UIColor grayColor]; 



// change color of Nav Bar in Edit View 
UINavigationBar *modalNavBar = [editView.subviews objectAtIndex:0]; 
modalNavBar.tintColor = [UIColor orangeColor]; 

// change title of Edit View 
modalNavBar.topItem.title = @"Edit Tabs"; 

}