简体   繁体   中英

Xamarin iOS Launch Screen Image In Storyboard Not Pulling From Asset Catalog

I'm using Visual Studio 2017 and the latest Xamarin iOS 10.10.0.30. I've tried following the documentation for creating a launch screen storyboard. I created all the launch screen images add added them in the Media tool under Asset Catalogs (both AppIcons and LaunchImages).

I'd prefer to just use these static images instead of creating a storyboard, but that doesn't seem to be an option. So, when creating the view for Resources\\LaunchScreen.storyboard, I add an Image View and go to properties and to the Image drop down. The images in the asset catalog are not listed in the drop down, but the Xamarin images in the Resources folder are listed. Something does not make sense.

Can we not use the LaunchImages from the asset catalog in Visual Studio? If we have to use a storyboard, how do we get it to select the right image for the device it is starting on?

It seems I am able to use the asset catalog launch images if I edit the info.plist in an XML editor and remove the UILaunchStoryboardName key. When I open it in the Manifest Editor it still says LaunchScreen....not sure what is with these settings.

I never did get this to work and now I am trying with another project using VS2017 and latest Xamarin iOS. Following the instructions here: https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/images-icons/displaying-an-image?tabs=vswin It does not select an image from an asset catalog, nor does it work with an image picked from the disk. There needs to be better doc for this.

Managing Launch Screens Starting with iOS 8, there are two ways that Launch Screens can be included in a Xamarin.iOS project:

Universal Storyboard - [Preferred] A special type of Storyboard can be added to the project and used as a universal Launch Screen that will automatically adjust to the size, orientation and resolution of the device instead of including multiple launch screen images at all supported resolutions and device orientations. This is the preferred method of handling launch screens. Asset Catalog Image Sets - [Deprecated] Starting with iOS 7, a special LaunchImage image assets can be added to the Assets.xcassets file in the App's project. All version of the image required to support all resolutions or device orientations are included in the Asset Catalog and grouped together.

https://developer.xamarin.com/guides/ios/application_fundamentals/working_with_images/deprecated/launch-screens/

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