App crash when set BackgroundImage in Xamarin.Foms

Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

I creating an app on Xamarin.Forms. When I set background a page by BackgroundImage="background.png" it's crash when load that page on real Android Device (Samsung J7 Prime). But's it work fine on Genymotion and Lumia Phone.
How to fix this!

Best Answers

  • Liêm_NguyễnLiêm_Nguyễn US ✭✭✭✭
    Accepted Answer

    @Isha_Dawar said:
    @Nguyen Liem Please check build action for the image resources you have added as for Droid project it should be Android Resources and for IOS it should be Bundle Resource. Hope it would help u!!

    Thank you!.
    I found my issue, because Image too big.

Answers

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭

    @Isha_Dawar said:
    @Nguyen Liem Please check build action for the image resources you have added as for Droid project it should be Android Resources and for IOS it should be Bundle Resource. Hope it would help u!!

    yeah, I have set it, but it's still crash

  • Liêm_NguyễnLiêm_Nguyễn USMember ✭✭✭✭
    Accepted Answer

    @Isha_Dawar said:
    @Nguyen Liem Please check build action for the image resources you have added as for Droid project it should be Android Resources and for IOS it should be Bundle Resource. Hope it would help u!!

    Thank you!.
    I found my issue, because Image too big.

  • AuriAuri USMember ✭✭

    I also learned from an Android dev friend a couple days ago you don't want images more than a megabyte in size. 1024x1024 was the max he was using, and found things were much more stable under that. Remember, Android still turns all that into bitmaps in the background.

Sign In or Register to comment.