Xamarin Forms image not showing-Android

Lilly White

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".)

Anton Tarasov

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Xamarin Forms image not showing

From Dev

Xamarin forms: Image is not showing in perfect circle

From Dev

adding custom border drawable to android RelativeLayout not showing - Xamarin Forms

From Dev

Margin to a Image in Xamarin Forms

From Dev

Toolbar item not showing in xamarin forms

From Dev

Xamarin Forms - Webview not showing up

From Dev

Showing downloaded image in ImageView not working in Xamarin.Android

From Dev

BackDoor for Xamarin Forms(Android)

From Dev

Xamarin Forms - Xamarin Forms Labs Camera on Page Showing Up

From Dev

Loader image in xamarin.forms?

From Dev

Xamarin Forms - Load image in a Button

From Dev

Bitmap image loading in xamarin forms

From Dev

Loader image in xamarin.forms?

From Dev

Xamarin Forms: Entry with background image

From Dev

Xamarin Forms Teechart - Draw Image

From Dev

Bitmap image loading in xamarin forms

From Dev

Xamarin Forms - Image To/From IRandomAccessStreamReference

From Dev

cannot display image in xamarin forms

From Dev

Aligning Image with Entry in Xamarin Forms

From Dev

Xamarin.Forms AppCompat MasterDetail no titlebar showing

From Dev

Xamarin Forms NavigationPage showing multiple back buttons

From Dev

Xamarin.Forms Shared is not display image in Android view, but display image in iOS view

From Dev

Xamarin.Forms Shared is not display image in Android view, but display image in iOS view

From Dev

Xamarin Forms Image/Embedded Image Problems

From Dev

Android Drawable Image not Showing

From Dev

imageview not showing image android

From Dev

Style an EntryCell Xamarin Forms Android

From Dev

Xamarin Forms Android GC loop

From Dev

xamarin forms - android widget update

Related Related

HotTag

Archive