Xamarin.iOS 上的启动屏幕未显示。而是显示蓝屏

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33756284/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 08:15:36  来源:igfitidea点击:

Launch screen on Xamarin.iOS not showing. A blue screen is shown instead

iosxamarinxamarin.iosxamarin.forms

提问by Bernardo Rocha

I'm having some trouble on showing a launch screen only on my real iPad Mini device. When I run my app, a blue screen is shown instead. I'm using an asset catalog to include the images. When I run on iPhone or on iPad 2 Simulators the launch screen shows perfectly! Inside the Contents.json file in my asset catalog there are 4 images for iPad. They are:

我在仅在真正的 iPad Mini 设备上显示启动屏幕时遇到了一些问题。当我运行我的应用程序时,会显示蓝屏。我正在使用资产目录来包含图像。当我在 iPhone 或 iPad 2 模拟器上运行时,启动屏幕显示完美!在我的资产目录中的 Contents.json 文件中有 4 张 iPad 图像。他们是:

- Default-portrait.png (768x1004)

- 默认-portrait.png (768x1004)

- [email protected] (1536x2008)

- 默认[email protected] (1536x2008)

- Default-Landscape.png (1004x768)

- 默认-Landscape.png (1004x768)

- [email protected] (2008x1536)

- 默认风景@2x.png (2008x1536)

The Status Bar Style "Hide during application launch" option inside info.plist is unchecked.

info.plist 中的状态栏样式“在应用程序启动期间隐藏”选项未选中。

I've followed the Managing Launch Screens with Asset Catalogs steps in Xamarin Launch Screen guide: http://developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/launch-screens/#asset-catalogs

我已经按照 Xamarin 启动屏幕指南中的管理启动屏幕和资产目录步骤进行了操作:http: //developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/launch-screens/#asset-catalogs

If someone knows what my mistakes are, please let me know! =]

如果有人知道我的错误是什么,请告诉我!=]

PS: Sorry for the bad English!

PS:抱歉英语不好!

采纳答案by Bernardo Rocha

Like James Montemagno and Kevin Mullins answered in this post Launch Screen, the new iOS devices need to use Storyboard instead of Assets Catalogs. I create a Storyboard and it works perfectly now.

就像 James Montemagno 和 Kevin Mullins 在这篇文章Launch Screen 中的回答一样,新的 iOS 设备需要使用 Storyboard 而不是 Assets Catalogs。我创建了一个故事板,现在它可以完美运行。

回答by Felix Alcala

You could check for correct upper/lower case letters. The simulator is not case sensitive, e.g. it will gladly accept a defAULT-PORtrait.png file. Your iOS device, on the other hand, iscase sensitive.

您可以检查正确的大写/小写字母。模拟器不区分大小写,例如它会很乐意接受 defAULT-PORtrait.png 文件。您的iOS设备,而另一方面,区分大小写的。

More specifically, I noticed that your files are called :

更具体地说,我注意到您的文件被称为:

Maybe it will help to dublecheck the spelling for all files, and asset catalogues to make sure they are consistent with your info.plist file.

对所有文件和资产目录的拼写进行双重检查可能会有所帮助,以确保它们与您的 info.plist 文件一致。