ContentPage.BackgroundImage issue.

shtpavelshtpavel UAMember

Hello
Got issues with setting ContentPage.BackgroundImage property on android. (iOS works great).
Tryin to do it like so:

this.BackgroundImage = "/images/some/image/image.png";

But got the error:

What can be the issue?

Posts

  • MitchMilamMitchMilam ✭✭✭ USMember ✭✭✭

    @shtpavel can you show us a screen shot of the folder where you have the image.png file?

  • shtpavelshtpavel UAMember

    @MitchMilam Yep here it is:

  • MitchMilamMitchMilam ✭✭✭ USMember ✭✭✭

    @shtpavel what folder is the images folder in? It needs to be in the Resources/Drawable folder for Android. I've also had trouble using subfolders across devices. Can you try a test and put one of the images in the main Drawable folder to see if that fixes the issue?

    If so, you may need to play with the path a bit. There also seems to be differences in forward vs. backward slashes. I never took the time to pin down all of caveats, but there are more than a few.

  • shtpavelshtpavel UAMember

    @MitchMilam Thanks, the solution is:
    "drawable/image.png"
    set the image as AndroidResource

    Thats it.

    Thanks a lot.

  • boomboomboomboom USMember
    edited April 2015

    @shtpavel : works good!

Sign In or Register to comment.