I have a Xamarin Forms Android app and when I'm using the following code
var image = new Image { Source = "lock.png" };
to show an image, but the image isn't showing though.
And then I try to change the source to Icon.png (the default Xamarin icon) and it working fine.
Does anybody know how to make this image show in my app?
(ps: image path : ".\MyApp.Droid\Resources\drawable\lock.png".)
Make sure that image has Build Action set to "Android Resource". Otherwise, it is not copied to final package properly and there is no image for app to show. This is described in guide here: https://developer.xamarin.com/guides/xamarin-forms/working-with/images/#Local_Images
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments