美文网首页
iOS 如何修改状态栏颜色为白色

iOS 如何修改状态栏颜色为白色

作者: alohasingle | 来源:发表于2016-12-22 15:02 被阅读0次

1.首先在plist文件中添加一key值:View controller-based status bar appearance设置为NO

2.在AppDelegate中添加代码:

- (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions {

// Override point for customization after application launch.

//状态栏设为白色

[UIApplicationsharedApplication].statusBarStyle=UIStatusBarStyleLightContent;

self.window=[[UIWindowalloc]initWithFrame:[UIScreenmainScreen].bounds];

}

相关文章

网友评论

      本文标题:iOS 如何修改状态栏颜色为白色

      本文链接:https://www.haomeiwen.com/subject/lrfhvttx.html