ios - 顶部栏在 iPhone 5 中可见但在 iPhone 6 中不可见

标签 ios xcode

我在模拟器 iPhone5 和 iPhone6 上运行我的代码。问题是顶部栏在 iPhone5 中可见,但在 iPhone6 或 iPhone6+ 中不可见。请查看附加图片。

enter image description here

enter image description here

可能是什么问题?

按照我设置顶部导航颜色的步骤

  1. 在信息部分做了一些改动 enter image description here

  2. 我在我的应用委托(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/

相关文章:

ios - 避免/禁用 iOS 中的状态保存

ios - 如何构建具有不同外观/品牌的不同版本的应用程序?

iOS - NSURLConnection - 检查 URL

iOS 推送风格 segue 过渡

ios - Xcode的Storyboard突然消失

ios - Json Values Append Array 但 ViewDidLoad 看起来是空的

NSTextView 中的 Xcode 风格占位符

ios - CoreMotion 的主线程检查器警告,仅出现在 2018 款 iPhone 上

iphone - 子项目的 Xcode 环境变量

xcode - 如何签署 Mac OS X 应用程序?