Images from Asset catalogs not loading on physical iPhone 5 but do show up on 6S and simulator

PaullnPaulln GBMember ✭✭
edited June 2016 in Xamarin.iOS

Hi all,

My app is loading images from an asset catalog.

I created the catalog by dragging and dropping in the Visual Studio editor.

When I load the app on a physical iPhone 6S, the simulator as a iPhone 6S or the simulator as a iPhone 5, the images display correctly.

When I load the app on a physical iPhone 5 none of them display.

In my project structure, all the images follow the same format:

Resources/Media.xcassets/Image1.imageset/image_1.png
Resources/Media.xcassets/Image1.imageset/[email protected]
Resources/Media.xcassets/Image1.imageset/[email protected]

and Resources/Media.xcassets/Image1.imageset/Contents.json is:

{
  "images": [
    {
      "scale": "1x",
      "idiom": "universal",
      "filename": "image_1.png"
    },
    {
      "scale": "2x",
      "idiom": "universal",
      "filename": [email protected]"
    },
    {
      "scale": "3x",
      "idiom": "universal",
      "filename": "i[email protected]"
    }
  ],
  "properties": {},
  "info": {
    "version": 1,
    "author": ""
  }
}

I am loading them using UIImage.FromBundle("Image1");. The value is fine on the physical 6S and the simulator 5 but null on the physical 5.

I tried the deprecated method of adding image_test.png, [email protected] and [email protected] loosely in the Resources/ folder and these load fine on all platforms.

Any advice on where I'm going wrong? I've deleted bin/iPhone/, cleaned and rebuilt numerous times with no luck.

Tagged:

Best Answer

Answers

Sign In or Register to comment.