0

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

- (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; 导航项目只是消失了......

4

1 回答 1

0

用这个

  viewController1.navigationBar.tintColor = [UIColor blackColor];
  viewController1.navigationBar.translucent = YES;
于 2012-10-11T15:55:20.263 回答