Image not appearing on Android

JjohnnyJjohnny AUUniversity ✭✭
edited August 2015 in Xamarin.Forms

I have an image in xamarin forms working on iOS but it just doesn't want to load on Android!

I have:

  • In the XAML [Image x:Name="HatsImage" Source="hats.png"/]
  • Put the image file in the Resources directory
  • Made sure the image's buildaction is set to to AndroidResource

Am I missing something?

Thanks!

Posts

  • adamkempadamkemp USInsider, Developer Group Leader mod

    It should be in the Resources/drawable* directory. There are different directories for different pixel densities. We map those to iOS resolutions like this:

    drawable-mdpi: 1x (i.e., non-retina)
    drawable-hdpi: 1.5x
    drawable-xhdpi: 2x (i.e., retina)

  • ImranBaigImranBaig AUMember

    I have all my images in Resources/Drawable already (forgot to type /drawable in my first post)

    Any other ideas?

  • adamkempadamkemp USInsider, Developer Group Leader mod

    Can you attach an example project showing me what you're trying?

Sign In or Register to comment.