Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I put a BackgroundImage in Xamarin.Forms UWP?

Good Day everyone. I'm currently creating the UWP part of my Xamarin.Forms Project and I want to put a BackgroundImage in it. I've noticed that the images I used in Xamarin.Forms.Droid are not being displayed on my UWP. Why is that so?

I used this code BackgroundImage="filename.jpg"

like image 419
Jaycee Evangelista Avatar asked Jun 27 '16 05:06

Jaycee Evangelista


People also ask

How do you bind an image source in Xamarin forms?

In Xamarin. Forms SfAvatarView, you can set the key for ImageSource by using ResourceDictionary and bind image from ViewModel to ImageSource. An ImageSource instance, can be either File, Uri or Resource, which sets the image to display.


Video Answer


1 Answers

Check the image and make sure that you place your images in the application's root directory with Build Action: Content.


Edit :

I suggest you to modify the code as :

BackgroundImage="//Assets/filename.jpg"
like image 140
Yksh Avatar answered Sep 21 '22 22:09

Yksh