7

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"

Jaycee Evangelista
  • 1,107
  • 6
  • 22
  • 52

1 Answers1

9

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"
Yksh
  • 3,276
  • 10
  • 56
  • 101
  • Sir where can i found the **application's root directory**? I've added the image to the Assets folder of my UWP. – Jaycee Evangelista Jun 27 '16 at 06:00
  • 1
    Place the image inside uwp project. Right click UWP project -> Add existing item -> add your image – GeralexGR Jun 27 '16 at 06:48
  • I'm having the same problem, my background image displays on Android but not on UWP. I'm using backgroundImage="background1" in MainPage.xaml. I put the image in Resources for Android and bigger image in Assets folder for UWP. I also set build action to content and copy to output directory = copy if newer – SendETHToThisAddress Apr 29 '20 at 08:17