修改狀態(tài)欄
在 Target::Info 欄里, 找到 Custom iOS Target Properties, 加入一項配置項:
Key: View controller-based status bar appearance
Type: Boolean
Value: NO
這樣, 就可以修改狀態(tài)欄的字體顏色了, 否則沒法改. 然后修改 AppDelegate:
- (BOOL)application:(UIApplication *)app didFinishLaunchingWithOptions:(NSDictionary *)opts {
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
}
修改導(dǎo)航欄背景和字體顏色
- (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;
}
tintColor: 導(dǎo)航欄的按鈕(如返回)顏色
titleTextAttributes: 標(biāo)題顏色
barTintColor: 背景顏色
translucent: 是否透明
from: http://www.tuicool.com/articles/b6vIV3a