iOS-Framework icon indicating copy to clipboard operation
iOS-Framework copied to clipboard

stretching images that were uploaded from bundle in ios 4.3 and below

Open ItayDag opened this issue 13 years ago • 2 comments

Hi When I import the images directly to the thrid-party project and try to stretch it using "stretchableImageWithLeftCapWidth" all is good.

but when I am trying to get the image from the bundle we created in the guide - it looks corrupted.

  • I am sure the stretching is right cause it works when I dont use the bundle.

This happens only on stretching ... is it possible that somehow the image is uploaded wrong. Note: it happens only on ios 4.X and in ios 5 it looks good.

Any ideas ?

Best regards

ItayDag avatar Apr 30 '12 09:04 ItayDag

Is this still an issue?

jverkoey avatar May 03 '12 17:05 jverkoey

unfortunately its still is, The only work around I found (which you cant exactly call a work around ) is not using the .bundle and to import a folder with my resources directly to the third-party project with my own global prefix to all the resources. (Well its much more nicer to use a .bundle I agree - but I am starting to think since you are not really hiding your resources from your users, why shouldn't you just upload it as a folder ? )

When I did it this way it worked good and all images were stretched as they should.

So to conclude :

  1. When I used the ".bundle" as you wrote in the guide I needed to change all the resources's names that had postfix of "[email protected]" to "....png" caused it didn't found them in the bundle otherwise
  2. After removing all @2x postfix all most images were shown badly on the device (was mostly seen when using stretching but not only )

I was reading that when loading high res images in ios4 it is automatically look for a resource with @2x postfix in its name, this way you can support the old 3Gs devices (holding 2 sets of images) Maybe when loading from bundle which is not the main bundle somehow skip this system stage of recognizing the @2x name. I will keep working on it and tell you if I came up with something,

You really helped me with this guide and I would love if you can tell me how can I contribute to your work (if I can)

Cheers

ItayDag avatar May 05 '12 10:05 ItayDag