我在模拟器 iPhone5 和 iPhone6 上运行我的代码。问题是顶部栏在 iPhone5 中可见,但在 iPhone6 或 iPhone6+ 中不可见。请查看附加图片。
和
可能是什么问题?
按照我设置顶部导航颜色的步骤
在信息部分做了一些改动
我在我的应用委托(delegate)文件中添加了以下代码
navigationController.navigationBar.translucent = NO; [navigationController.navigationBar setTintColor:[UIColor whiteColor]]; [[UINavigationBar 外观] setBarTintColor:[UIColor blackColor]]; [[UINavigationBar 外观] setTitleTextAttributes:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:[UIColor whiteColor], nil] forKeys:[NSArray arrayWithObjects:NSForegroundColorAttributeName, nil]]];
最佳答案
在 info.plist 中将 UIViewControllerBasedStatusBarAppearance 设置为 NO。
打电话
[[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent];
在应用程序中确实完成了启动方法。
并删除所有其他内容。
关于ios - 顶部栏在 iPhone 5 中可见但在 iPhone 6 中不可见,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30011279/