简体   繁体   English

iPad Pro上带有圆角的黑色状态栏

[英]Black status bar on the iPad Pro with rounded corners

My app always runs in compatibility mode on the new iPad Pro Simulator. 我的应用程序始终在新的iPad Pro Simulator上以兼容模式运行。 I've installed the latest Xcode 10.1. 我已经安装了最新的Xcode 10.1。 I've verified it is linked against the latest iOS 12.1. 我已验证它是否与最新的iOS 12.1链接。 When I run it on an iPhone XS, it correctly uses Safe area insets. 当我在iPhone XS上运行它时,它正确使用了安全区域插图。 Yet it shows a black status bar and a black stripe at the bottom where the Home indicator is located. 但是,它在“主页”指示器所在的底部显示黑色状态栏和黑色条纹。

Even when I create a sample app with Xcode 10.1 and run it on the iPad Pro Simulator, it is launched in compatibility mode: 即使当我使用Xcode 10.1创建示例应用程序并在iPad Pro Simulator上运行它时,它也会以兼容模式启动:

iPad Pro上兼容模式下的Sampe应用

How to make the app use the whole screen? 如何使应用程序使用整个屏幕?

I was seeing the same issue simply by creating a fresh iOS app using the Single View app or the Master-Detail app templates. 我只是通过使用Single View应用程序或Master-Detail应用程序模板创建一个全新的iOS应用程序而看到了相同的问题。

I got it working as expected by doing the following: 通过执行以下操作,我按预期工作:

I deleted all versions of Xcode installed on my computer. 我删除了计算机上安装的所有Xcode版本。 I went to my ~/Library/Developer/Xcode folder and I deleted the following: 我转到~/Library/Developer/Xcode文件夹,并删除了以下内容:

  • All files named DeveloperPortal* 所有名为DeveloperPortal*文件
  • The DerivedData folder DerivedData文件夹
  • The Installs folder (which just had some empty folders in it) Installs文件夹(其中只有一些空文件夹)
  • Under UserData/IB Support I deleted the Simulator Devices folder UserData/IB Support我删除了Simulator Devices文件夹

Then I did a fresh download and install of Xcode 10.1 from the App Store. 然后,我从App Store重新下载并安装了Xcode 10.1。

After that, a clean build of the test app worked as expected. 在那之后,测试应用程序的干净版本按预期工作。 I don't know which of the above steps was really needed but I got it working. 我不知道上述步骤中的哪一个确实需要执行,但我可以执行。

I tried the above answer and it did not fix my problem. 我尝试了上述答案,但没有解决我的问题。 I did fix my problem by setting a .storyboard file as my Launch Screen File in Project->Target->General. 我确实通过在项目->目标->常规中将.storyboard文件设置为启动屏幕文件来解决问题。 Previously, I had been using Launch Images for my splash screen. 以前,我一直在启动屏幕上使用启动图像。

This is mentioned in the "Optimizing Your UI" section here: https://developer.apple.com/ipad/ 此处的“优化用户界面”部分中提到了这一点: https : //developer.apple.com/ipad/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM