danwellman
danwellman

Reputation: 9253

Xamarin LaunchImage not listed as a source in ImageView properties

I'm working on a mobile app for iOS/Android. I'm using Visual Studio Community for Mac version 8.1.5, and the project was initially created as a new Tabbed Forms Xamarin App.

When the new project was created, the Assets.xcassets "folder" already contained two items - AppIcon and LaunchImage, with the LaunchImage screen looking like this:

enter image description here

I didn't create this, it already existed. There was also a LaunchScreen.storyboard file, and in the info.plist file, the iPhone Launch Images setting was already set to LaunchImage (the name of the image set in xcassets that already existed and which is shown in the screenshot above), and the Launch Screen setting was set to LaunchScreen:

enter image description here

I then added a bunch of images to a subfolder in the Resources folder, added each image to the correct box in the xcassets screen, saved everything and then tried to add an image to the LaunchScreen.storyboard file.

Unfortunately, when I add an Image View control to the Launch Screen, the Image dropdown in the widget properties does not list the LaunchScreen as an asset I can use!

If I create a new Image Set in the xcassets folder, it creates a screen like this:

enter image description here

This has nowhere near the number of different images sizes (I guess because it's a general image, not an image specifically for the launch screen), but, I can set the Image View on the launch screen to use this set.

So my question is: how can I use the LaunchImage screen (with its many different sizes for different devices) as the source of an Image View widget on the LaunchScreen story-board? What am I missing?

Upvotes: 0

Views: 905

Answers (1)

Junior Jiang
Junior Jiang

Reputation: 12723

Here is the guide for Launch Screens for Xamarin.iOS Apps .

You can pay attention to the third section of this chapter (Managing Launch Screens with Storyboards) ,

  1. Add an image to the Assets.xcassets Asset Catalog so that it is available for use on the Launch Screen. For more information, see the Adding Images to an Asset Catalog Image Set section of the Displaying an Image guide.

Explain:

enter image description here

  1. If clicking Launch Image selection. ImageView's droplist can not see it.Because this is used as System image, and if want to show in LauchScreen. You should set in info.plist as follow: (Only set Source , not set LaunchScreen)

enter image description here

  1. If clicking Image Set In Asset Cattalogs , then ImageView's droplist can see added ImageSet Name there.But first need to set info.plist as follow:

enter image description here

enter image description here

enter image description here

enter image description here

Upvotes: 2

Related Questions