简体   繁体   中英

Xamarin Forms iOS Launch Screen Image Position

I am using Xamarin Studio and have a Xamarin Forms project for both iOS and Android. For my iOS app, I have created a xib file for my launch screen. I have added an image view and and an image to that view. Every time I change the simulated metrics size (in Xcode) the image repositions itself (same if I run on different sized iDevices). How do I correct this? I want the image always centered vertically and about 1/3 of the way down from the top. Thanks

As mentioned on the Xamarin Launch Screen Guide , if you use a Universal Launch Screen and click Enable Size Classes , then your Launch Screen will automatically scale dependent on the screen size.

I also personally found, that I needed to use Center Constraints for my ´Views` as described here . As mentioned in the guide:

If you choose a horizontal drop area, the constraint will be based on centerX

Hope this helps.


Edit

You may need to open the .xib file in XCode as there is an issue opening Universal Screens in in Xamarin Studio.

Additionally, to enable Size classes in XCode, simply follow this guide .

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