UINavigationBar样式没有变化

时间:2012-10-11 15:48:57

标签: iphone uinavigationcontroller styles uinavigationbar

我想让它变成半透明的黑色,为什么这不起作用?

- (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 = UIBarStyleBlackTranslucent时;导航项只是消失......

1 个答案:

答案 0 :(得分:0)

使用此

  viewController1.navigationBar.tintColor = [UIColor blackColor];
  viewController1.navigationBar.translucent = YES;