ios - is retina working in my developer iphone? -
i'm testing app in iphone5.
i duplicate image, named image1.png , image1@2x.png, , tried in iphone5, in part of code:
uiimage *myimage = [uiimage imagenamed:@"image1.png"] ; cgfloat imagewidth = myimage.size.width; cgfloat imageheight = myimage.size.height; nslog(@"image %f %f", imagewidth,imageheight); cgrect screenbound = [[uiscreen mainscreen] bounds]; cgsize screensize = screenbound.size; cgfloat screenwidth = screensize.width; cgfloat screenheight = screensize.height; nslog(@"screen %f %f", screenwidth, screenheight);
and when running in iphone, in console see:
2013-04-05 13:13:48.386 vallabici[2413:907] image 320.000000 57.000000 2013-04-05 13:13:48.389 vallabici[2413:907] screen 320.000000 568.000000
as using normal screen instead of retina.
how can be?
the size of image should not change on retina device, scale. take scale of image add following log:
nslog(@"scale %f", myimage.scale);
Comments
Post a Comment