Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 89864

How to manage images and page background images ?

$
0
0

Hi guys,

I am facing an issue with images, specially with Android builds, although I follow Xamarin doc guidelines. I have a background images named background.jpg, located in :

  • MyProject : root folder
  • MyProject.Android : Resources/drawable ==> I created the drawable folder, as it did not exist ; Build Action: AndroidResource
  • MyProject.UWP : root folder ; Build Action: Content
  • MyProject.iOS : in a new image set, I put only the image in Vector (.pdf file), as mentionned in Xamarin doc

When I try to use this image (can't test on iOS) :

  • As ContentPage.BackgroundImageSource : it doesn't work (image is not loaded), unless I use it as a MyProject resource (BackgroundImageSource = ImageSource.FromResource("MyProject.background.jpg");) that I don't want because I may want to manage multiple resolutions...
  • As a simple Image in XAML (Image Source="background.jpg") : works on UWP, but not on Android (emulator) with exception : Unhandled Exception: Java.Lang.RuntimeException: Timeout exceeded getting exception details

What am I doing wrong ?
Thanks


Viewing all articles
Browse latest Browse all 89864

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>