I read from http://www.apple.com/iphone/specs.html that IPhone4's screen is 960-by-640-pixel resolution at 326 ppi.
But in Xcode's IPhone4.3 simulator, when I manipulate the display objects, print the [UIScreen mainScreen].applicationFrame, it is 320*480.
So if I wanna use a picture as the main screen's background of my app, which size I should use? 640*960 or 320*480?
Or Which kind of images should I use ? The size of images can affect the details a lot.
You can use both.
If you want to develop apps to Retina Display (iPhone 4), then you should use image with double resolution (640x960), then, when you create your UIImageView, you divide the size by 2.
CGRect rect = imageView.frame;
rect.size.width /= 2;
rect.size.height /= 2;
imageView.frame = rect;
Also, you have the option to have a image with @2x on its name, for example [email protected]
(640x960). In this case, you don't need to divide the size. Using this way:
UIImage * img = [UIImage imageNamed:@"myimage.png"];
Your img var has already divided the size, and if you deploy to iPhone4 it has Retina Display resolution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With