简体   繁体   中英

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

I am using Visual Studio 2019 with Xamarin Forms. 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). 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.

Steps I've taken:

  1. I edit the launchscreen.story board>
  2. Select an image for a iOS device (Say iPhone 8 Plus)
  3. While image is highlighted, I select Layout>Fill Parent Buttons and Position Buttons. 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. 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.

How can I have each image setting for the same image be different in launchscreen.storyboard separately for each devices?

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 devices have a variety of screen sizes and can be used in either portrait or landscape orientation. In edge-to-edge devices like iPhone X and iPad Pro , the display has rounded corners that closely match the device's overall dimensions. Other devices — such as iPhone SE and iPad Air — have a rectangular display.

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). That is to say the size of image should be 750 x 1334 (Portrait). 640x1136 is for iPhone 5(5s).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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