简体   繁体   English

单个 Launchscreen.storyboard 启动画面未按比例显示在 Xamarin Z645024253191298AE688A3 中的各种 iOS 设备中

[英]Single Launchscreen.storyboard splash image not displaying proportionally in various iOS devices in Xamarin Forms

I am using Visual Studio 2019 with Xamarin Forms.我正在使用带有 Xamarin Forms 的 Visual Studio 2019。 I am unable to get a single image (size 640x1136) as a splash screen image to display properly on iOS devices (It displays but not proportionally per the device).我无法将单个图像(尺寸 640x1136)作为初始屏幕图像在 iOS 设备上正确显示(它显示但不按设备比例显示)。 I want the image to be auto-size depending on the screen to be full screen.我希望图像根据屏幕自动调整大小为全屏。 If I get it working perfectly for an iOS device (say for iPhone 8), it looks skewed to the left or cut off and when editing the launchscreen.storyboard.如果我让它在 iOS 设备(比如 iPhone 8)上完美运行,它看起来会向左倾斜或被切断,并且在编辑 launchscreen.storyboard 时。

Steps I've taken:我采取的步骤:

  1. I edit the launchscreen.story board>我编辑了launchscreen.story board>
  2. Select an image for a iOS device (Say iPhone 8 Plus) Select iOS 设备的图像(比如 iPhone 8 Plus)
  3. While image is highlighted, I select Layout>Fill Parent Buttons and Position Buttons.突出显示图像时,我 select 布局>填充父按钮和 Position 按钮。 Now my splash image fits my device nicely (uses whole screen) Save.现在我的初始图像非常适合我的设备(使用整个屏幕)保存。

Now, while in storyboard, I select another iOS device (Say iPhone 11) The image is not displayed properly.现在,在 storyboard 中,我在 select 另一个 iOS 设备(比如 iPhone 11)中无法正确显示图像。 In fact it is saved, specifically with the settings for the screen of iOS 8, so the image is not proportional to the new iOS device.事实上它被保存了,特别是iOS 8的屏幕设置,所以图像与新的iOS设备不成比例。

How can I have each image setting for the same image be different in launchscreen.storyboard separately for each devices?如何在launchscreen.storyboard中为每个设备分别设置同一图像的每个图像设置?

I have tried to click the Edit Traits button, and use the same image but the same issue is there.我尝试单击“编辑特征”按钮,并使用相同的图像,但存在相同的问题。

Any direction appreciated.任何方向表示赞赏。

Thank you in advance先感谢您

In iOS, we need to provide the same Image with different size to fit different device.在 iOS 中,我们需要提供不同尺寸的相同图像以适应不同的设备。

iOS devices have a variety of screen sizes and can be used in either portrait or landscape orientation. iOS 器件具有多种屏幕尺寸,可用于纵向或横向。 In edge-to-edge devices like iPhone X and iPad Pro , the display has rounded corners that closely match the device's overall dimensions.iPhone XiPad Pro等无边框设备中,显示屏的圆角与设备的整体尺寸非常匹配。 Other devices — such as iPhone SE and iPad Air — have a rectangular display.其他设备(例如iPhone SEiPad Air )具有矩形显示屏。

If your app runs on a specific device, make sure it runs on every screen size for that device.如果您的应用程序在特定设备上运行,请确保它在该设备的每个屏幕尺寸上运行。

The following image is the launch image size of different device.下图是不同设备的启动图像大小。

在此处输入图像描述

In your case, iPhone 8 needs an image or icon with high Scale Factor *(@2x).在您的情况下,iPhone 8 需要具有高比例因子 *(@2x) 的图像或图标。 That is to say the size of image should be 750 x 1334 (Portrait).也就是说图像的大小应该是750 x 1334 (Portrait)。 640x1136 is for iPhone 5(5s). 640x1136适用于 iPhone 5(5s)。

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

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