在iPhone X模拟器的顶部和底部看到黑条

时间:2022-01-07 18:57:42

Running my App in the iPhone X Simulator (GM Seed) I am noticing two strange effects:

在iPhone X模拟器上运行我的应用程序(GM Seed),我注意到两个奇怪的效果:

  • the App does not use the full screen space (top and bottom area is black)
  • App不使用全屏空间(上下区域为黑色)
  • a strange white bar beneath the title bar
  • 标题栏下面奇怪的白色条

在iPhone X模拟器的顶部和底部看到黑条

Does anybody know what is happening here and how to resolve this? I can't find any new settings in Interface Builder.

有人知道这里发生了什么吗?在接口构建器中我找不到任何新的设置。

6 个解决方案

#1


145  

When using launch images (instead of the much easier Launch screen file), you need to provide the properly sized launch image for each device size you wish to support. Once you add the additional launch image, your app should take advantage of the new screen size.

使用启动映像(而不是更容易的启动屏幕文件)时,需要为希望支持的每个设备大小提供适当大小的启动映像。一旦你添加了额外的启动图像,你的应用程序应该利用新的屏幕尺寸。

The new iPhone X requires a launch image sized at 1125px × 2436px which is a 3x image for 375pt × 812pt.

新的iPhone X需要发射图像大小为1125 px×2436 px是3 X 375 pt×812 pt形象。

Of course if you switch over to using a Launch screen file instead of individual launch images, your app will automatically adapt to all device sizes without any additional work.

当然,如果你切换到使用启动屏幕文件而不是单独的启动图像,你的应用程序将自动适应所有设备大小,不需要任何额外的工作。

#2


24  

I have figured out this issues in iPhone X. Launch image size (1125*2436px) Please flow this below steps. 1.i)Choose your project name in Xcode. ii)Select your project target iii)Then select Launch images source 在iPhone X模拟器的顶部和底部看到黑条

我在iPhone x中已经解决了这个问题。启动图像大小(1125*2436px)请按以下步骤进行。1.i)在Xcode中选择项目名称。ii)选择您的项目目标iii)然后选择发射图像源

  1. You can get Migrate popup i) Choose Assets ii)Select Migrate
  2. 你可以得到迁移弹出窗口i)选择资产ii)选择迁移

在iPhone X模拟器的顶部和底部看到黑条

  1. After that select your Assets.xcassets in your project 在iPhone X模拟器的顶部和底部看到黑条

    然后选择您的资产。xcassets在您的项目中

  2. Then select Launch image in assets i)Then select attribute inspector在iPhone X模拟器的顶部和底部看到黑条

    然后在assets i中选择Launch image),然后选择attribute inspector

  3. finally check your Launch image source. you can see set Launch image.

    最后检查发射图像源。你可以看到set Launch image。

在iPhone X模拟器的顶部和底部看到黑条

#3


17  

iPhone X needs different launch image sized 1125px x 2436px (375pt x 812pt @3x).

iPhone X需要不同大小的发射图像1125px X 2436px (375pt X 812pt @3x)。

在iPhone X模拟器的顶部和底部看到黑条

Check human interface guidelines for more details.

查看人机界面指南了解更多细节。

#4


9  

I have figured out how to fix (though I still don't understand why this happened only on iPhone X) LaunchScreen storyboard on iPhone X with seeing black top&bottom bars.

我已经知道如何修复(尽管我仍然不明白为什么这只发生在iPhone X上)在iPhone X上启动屏幕故事板,看到黑色的上下条。

I have LaunchScreen storyboard with one UIImageView.

我有一个UIImageView的LaunchScreen storyboard。

UIImageView's top&bottom has to be pinned to SuperView's top&bottom. NOT to SafeArea.

UIImageView的顶部和底部必须固定在父视图的顶部和底部。不要SafeArea。

#5


7  

I fixed it by simply inserting some random text in the Lanch Screen File textfield. I dont even have a Launch Screen File... XCode is so buggy.

我通过在Lanch屏幕文件textfield中插入一些随机文本来修复它。我甚至没有启动屏幕文件……XCode车。

update

更新

Although this fixes it in simulator (still very weird and unexpected) when uploading a binary to iTunes Connect it will fail due to not finding a LanchScreen file of name "random-name"

虽然这修复了它在模拟器(仍然非常奇怪和出乎意料)当上传一个二进制文件到iTunes Connect时,它将失败,因为没有找到一个名为“random-name”的LanchScreen文件

#6


0  

If you already have a 1125px × 2436px launch image but the app is still not using the full screen check to make sure that your image is PNG.

如果你已经有一个1125 px×2436 px发射图像,但应用程序仍不使用全屏检查以确保你的PNG图像。

#1


145  

When using launch images (instead of the much easier Launch screen file), you need to provide the properly sized launch image for each device size you wish to support. Once you add the additional launch image, your app should take advantage of the new screen size.

使用启动映像(而不是更容易的启动屏幕文件)时,需要为希望支持的每个设备大小提供适当大小的启动映像。一旦你添加了额外的启动图像,你的应用程序应该利用新的屏幕尺寸。

The new iPhone X requires a launch image sized at 1125px × 2436px which is a 3x image for 375pt × 812pt.

新的iPhone X需要发射图像大小为1125 px×2436 px是3 X 375 pt×812 pt形象。

Of course if you switch over to using a Launch screen file instead of individual launch images, your app will automatically adapt to all device sizes without any additional work.

当然,如果你切换到使用启动屏幕文件而不是单独的启动图像,你的应用程序将自动适应所有设备大小,不需要任何额外的工作。

#2


24  

I have figured out this issues in iPhone X. Launch image size (1125*2436px) Please flow this below steps. 1.i)Choose your project name in Xcode. ii)Select your project target iii)Then select Launch images source 在iPhone X模拟器的顶部和底部看到黑条

我在iPhone x中已经解决了这个问题。启动图像大小(1125*2436px)请按以下步骤进行。1.i)在Xcode中选择项目名称。ii)选择您的项目目标iii)然后选择发射图像源

  1. You can get Migrate popup i) Choose Assets ii)Select Migrate
  2. 你可以得到迁移弹出窗口i)选择资产ii)选择迁移

在iPhone X模拟器的顶部和底部看到黑条

  1. After that select your Assets.xcassets in your project 在iPhone X模拟器的顶部和底部看到黑条

    然后选择您的资产。xcassets在您的项目中

  2. Then select Launch image in assets i)Then select attribute inspector在iPhone X模拟器的顶部和底部看到黑条

    然后在assets i中选择Launch image),然后选择attribute inspector

  3. finally check your Launch image source. you can see set Launch image.

    最后检查发射图像源。你可以看到set Launch image。

在iPhone X模拟器的顶部和底部看到黑条

#3


17  

iPhone X needs different launch image sized 1125px x 2436px (375pt x 812pt @3x).

iPhone X需要不同大小的发射图像1125px X 2436px (375pt X 812pt @3x)。

在iPhone X模拟器的顶部和底部看到黑条

Check human interface guidelines for more details.

查看人机界面指南了解更多细节。

#4


9  

I have figured out how to fix (though I still don't understand why this happened only on iPhone X) LaunchScreen storyboard on iPhone X with seeing black top&bottom bars.

我已经知道如何修复(尽管我仍然不明白为什么这只发生在iPhone X上)在iPhone X上启动屏幕故事板,看到黑色的上下条。

I have LaunchScreen storyboard with one UIImageView.

我有一个UIImageView的LaunchScreen storyboard。

UIImageView's top&bottom has to be pinned to SuperView's top&bottom. NOT to SafeArea.

UIImageView的顶部和底部必须固定在父视图的顶部和底部。不要SafeArea。

#5


7  

I fixed it by simply inserting some random text in the Lanch Screen File textfield. I dont even have a Launch Screen File... XCode is so buggy.

我通过在Lanch屏幕文件textfield中插入一些随机文本来修复它。我甚至没有启动屏幕文件……XCode车。

update

更新

Although this fixes it in simulator (still very weird and unexpected) when uploading a binary to iTunes Connect it will fail due to not finding a LanchScreen file of name "random-name"

虽然这修复了它在模拟器(仍然非常奇怪和出乎意料)当上传一个二进制文件到iTunes Connect时,它将失败,因为没有找到一个名为“random-name”的LanchScreen文件

#6


0  

If you already have a 1125px × 2436px launch image but the app is still not using the full screen check to make sure that your image is PNG.

如果你已经有一个1125 px×2436 px发射图像,但应用程序仍不使用全屏检查以确保你的PNG图像。