ios - xcode 6 asset catalog iphone 6 -
this problem still hasn't been answered. when using asset catalog, device specific (not universal), options 1x, 2x, r 2x, 3x. 1x unnecessary not retina. 2x ip4 res 640x960. r 2x ip5 res 640x1136. 3x ip6plus res of 1242x2208.
now when run simulator ip6 (not ip6plus!), uses 2x image (640x960 res ip4) , not upscaling fill screen (which wouldn't create sense anyhow ratios don't fit).
has found proper guide setting background images new phones? don't mean explanation how various res sizes scaling, that's clear, how work around obvious mismatch between xcassets image @2x shares ip4 , ip6? thanks!
edit: xcode asset catalog back upwards 3.5", 4", , 4.7" @2x images? similar question not solved, workaround using universal instead of device specific. know improve way?
i have reported bug apple since mid nov 2014 , noticed marked no value... gives me impression apple has omitted additional slot iphone 6 on purpose. guess want 2x slot used iphone 6, , maybe they're reducing back upwards iphone 4s it's getting old.
if want maintain supporting iphone 4s, i'd suggest utilize iphone 6 sized images in 2x slot, , utilize next method load images:
+(uiimage *)loadimagenamed:(nsstring *)imagename { cgsize screensize = [uiscreen mainscreen].bounds.size; cgfloat screenheight = max(screensize.width, screensize.height); cgfloat const iphone_4_screen_height = 480; uiimage *image = [uiimage imagenamed:imagename]; if(screenheight == iphone_4_screen_height) { cgfloat const xscale = .85333333;//x conversion ratio iphone 6's 375 pts width screen iphone 4's 320 pts width screen cgfloat const yscale = .71964018;//y conversion ratio iphone 6's 667 pts height screen iphone 4's 480 pts height screen cgsize newsize = cgsizemake(xscale * image.size.width, yscale * image.size.height); uigraphicsbeginimagecontextwithoptions(newsize, no, 0); [image drawinrect:(cgrect){0, 0, newsize}]; uiimage *resizedimage = uigraphicsgetimagefromcurrentimagecontext(); uigraphicsendimagecontext(); homecoming resizedimage; } homecoming image; }
resizing big image (iphone 6) smaller 1 (iphone 4s) doesn't lose much quality if aspect ration not same.
edit:
this apple relations reply bug report:
there no plans address based on following:
we introduced size classes in ib. such, want developers utilize xib image view controls how image loaded , displayed. in event absolutely must provided pixel perfect images possible screen sizes, need suggested , determine specific resources load themselves.
we closing report.
if have questions resolution, or if still critical issue you, please update bug study information.
please sure regularly check new apple releases updates might impact issue.
ios iphone xcode
No comments:
Post a Comment