默认状态栏为黑色,对于某些App不是很美观,变成白色很简单,只需要两个步骤。
1.在Info.plist中添加新项目,View controller-based status bar appearance,Boolean值为No.
2.在AppDelegate的- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions方法中添加
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent animated:NO];
时间: 2024-10-07 11:52:44