Wednesday 15 January 2014

ios8 - Xcode 6 loads 3x image incorrectly when app's Deployment Target is set to 6.0 or 6.1 -



ios8 - Xcode 6 loads 3x image incorrectly when app's Deployment Target is set to 6.0 or 6.1 -

i issue when building ui in storyboard (or xib) in xcode's interface builder. after assign image (with same name in asset catalog) image view in interface builder, xcode loads 3x image file instead of 2x in non-retinahd devices running ios8.

note bug happens when app's deployment target set 6.0 or 6.1.

i'm using asset catalog manage image resources.

this issue tested , happens both in xcode 6.0.1 , 6.1 gm seed 2.

i googled issue , find related topic. wonder if 1 gets same issue me , best workaround it. give thanks you.

the next steps reproduce issue in case has interest:

install xcode 6

create ios project , set utilize objective-c project language.

change app's deployment target 6.0 or 6.1.

add 1x, 2x , 3x version of image asset catalog.

in interface builder, add together uiimageview default view controller's view of default storyboard.

in interface builder, set image's name same image name added in step 4 in asset catalog.

select simulator iphone6 (or simulator runs on ios 8.0 except iphone6 plus).

clean project (product/clean).

run project.

update:

as @andrei mankevich mentioned in comment, bug seems fixed in ios 8.1.

and have confirmed using simulator running ios 8.1 in xcode 6.1 gm seed 2(sorry don't have real device running ios 8.1 currently).

so @andrei mankevich pointed out, bug might exist in ios 8.0.x.

after research looks issue related ios indeed , isn't fixed upcoming xcode update. that's documentation says asset catalog:

for projects deployment target of @ to the lowest degree ios 7 or os x 10.9, xcode compiles asset catalogs runtime binary file format reduces download time app.

so when utilize deployment target 6.0 resources stored in different way within ipa file. while ios 8.0 loading compiled resouces correctly, has issue loading non-compiled resources , loads 3x density images. , issue fixed in ios 8.1.

as possible workaround in our app fixed setting exact size of each element in xib , using uiviewcontentmodescaleaspectfit value contentmode flag . utilize same image resources different resolution after scale same. of course of study should have negative impact on performance.

xcode ios8 resolution deployment-target

No comments:

Post a Comment