我想让它变成半透明的黑色,为什么这不起作用?
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
UINavigationController *viewController1 = [[UINavigationController alloc] init];
viewController1.navigationBar.barStyle = UIBarStyleBlackTranslucent;
RSSViewController *rssViewController = [[RSSViewController alloc] init];
[viewController1 addChildViewController:rssViewController];
UIViewController *viewController2 = [[CalendarViewController alloc] initWithNibName:@"CalendarViewController" bundle:nil];
self.tabBarController = [[UITabBarController alloc] init];
self.tabBarController.viewControllers = @[viewController1, viewController2];
self.window.rootViewController = self.tabBarController;
[self.window makeKeyAndVisible];
[self customizeInterface];
return YES;
}
当我把 viewController1.navigationBar.barStyle = UIBarStyleBlackSemilycent 时; 导航项只是消失了...
使用这个
viewController1.navigationBar.tintColor = [UIColor blackColor];
viewController1.navigationBar.translucent = YES;