在 Target::Info 栏里, 找到 Custom iOS Target Properties, 加入一项配置项:
Key: View controller-based status bar appearance Type: Boolean Value: NO
这样, 就可以修改状态栏的字体颜色了, 否则没法改. 然后修改 AppDelegate:
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)opts { [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; }
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)opts { self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; UINavigationController *nav = [[UINavigationController alloc] init]; nav.navigationBar.tintColor = [UIColor whiteColor]; nav.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor whiteColor]}; nav.navigationBar.barTintColor = [UIColor blueColor]; nav.navigationBar.translucent = NO; self.window.rootViewController = nav; [self.window makeKeyAndVisible]; return YES; }