iPad Retina - iPad uses the iPhone retina images - iphone

This is a little bit weird. Now, I am developing an app that's universal. However, I don't provide images for the iPad retina (iPad 3 and 4), but still retina images available for the iPhone. Now, the app uses the retina images of iPhone on iPad 3 and 4 instead of using the non retina, yet with correct size, iPad images.
To clear this out:
- iPad 1 and 2 uses the iPad non retina images (normal).
- iPad 3 & 4 uses the iPhone retina images instead of the iPad non retina images!
I tried a solution where I renamed the iPhone retina images so that it will end with ~iphone#2x. This fixes the issue on the iPad 3 and 4 but now the iPhone 4, 4s & 5 uses the non retina images!

IIRC, you got it the other way around. It should be myimage#2x~iphone.png.

Related

Launch app on iPad in 2x mode with iOS 7

Before iOS 7, iPhone apps that opened on iPads used to launch in 2x mode. iOS 7 seems to force all apps, even if they weren't designed for the iPad, to launch in 1x mode. How can we force our app to launch in 2x mode on iPads using iOS 7?
iPhone apps on iPads running iOS 7 now always open as a Retina iPhone app, while on iOS 6 they opened as a non-retina apps on non-retina iPads.
On Retina iPads (iPad 3 and 4) the apps may display in 1x (iPhone sized) or 2x (taking as much of the iPad screen as possible) and may be toggled.
On non-Retina iPads (iPad 2 and iPad mini) the apps only display in 2x mode and cannot be toggled. This is because the non-retina iPads do not have enough pixel density to display the retina iPhone apps at the "normal" size.
This behavior is determined by the OS and cannot be changed by your app.

When I run iPhone app on iPad the screen resolution is wrong. How to fix this?

I encountered with a strange problem. I develop an application which is targeting iPhone device family with Retina 3.5 and 4. All the time I used iPhone 5 simulator to test all the UI and functionality and everything was good but know I have to test push notifications. I have iPad 4 (model MD522ZP/A) as an iOS 6 device. When I run my app on it all the UI layout became wrong. The most weird problem is when I tried to check display resolution with this code:
NSLog(#"RESOLUTION = %#", NSStringFromCGSize([UIScreen mainScreen].bounds.size));
I got this : RESOLUTION = {320, 480}. But it is iPhone 3 resolution! Why iPad didn't use Retina 3.5/4 resolution ? And how can I fix it? I don't want to create separate xibs only for iPad testing but I want to test my app on it so that all the UI elements will fit on screen.
Hope for the help.
It's not wrong. It is doing exactly the right thing. All references to sizes are in points, not pixels. When you get the bounds, it will be 320x480 on all 3.5" screens whether they are retina or not. Try it on any 3.5" retina device. You will get the same log output.
The iPad does not emulate a 4" device when running an iPhone-only app. It will always be a 3.5" iPhone compatible mode.
So seeing 320x480 is the correct size to expect.
Think of it this way. A retina iPad will show an iPhone-only app like it is running on a 3.5" retina iPhone. A non-retina iPad will show an iPhone-only app like it is running on a 3.5" non-retina iPhone.

Cocos2d doesn't use the entire screen of iphone 5

I have a problem with my application ios. It is a universal application of cocos2d 6.0. It works on ipad, iphone 3GS, 4, 4S. Iphone 5 on I can start the application but cocos2d does not use the entire screen. Like iPhone 4. Do you have any idea??
Thank's
Have you added to your project the Default-568h#2x.png launch image? This will make your app use the full iPhone 5 screen.
If you do not include that launch image, then your app will work in boxed mode (i.e., centered on screen with black bands above and below to fill the entire area).
Note : this is due to the devices different screen resolutions :
iPhone 4 : 960x640 px.
iPhone 5 : 1136x640 px.
This happens due to screen size differences between iphone5 and iphone 3G, 4, 4s.
iPhone 4 :960 x 640 px
iPhone 5 1136 x 640 px
You should use Default-568h#2x.png image name for your launch image. On starting iphone 5 will load this image which will cover whole screen, While for other images in your game(If you have different images for iPhone5) use following code in your AppDelegate.m
[CCFileUtils setiPhoneFourInchDisplaySuffix:#"your suffix"];
And place images in project according to your suffix.

Sharp images in iPhone app but grainy images in iPad app

We're using retina images in our iPhone app (i.e., double the size).
The images render great on an iPhone 4 -- sharp and crisp. However, for the same app, the images look grainy on an iPad when run in "1x" mode (i.e., iPhone app size).
The code is exactly the same for both apps. There is no iPad version. People just download the iPhone version on iPads.
Are we supposed to use different images for the iPad?
Here is the app: http://itunes.apple.com/app/dumpling/id514239919
If you download it on an iPhone and then again on an iPad, you'll see the difference.
If the app is not universal then they are rendering the iPhone version on the iPad. I'm assuming you aren't in "2X" mode so if you are on an iPad 1 or 2 your app would not be using the retina graphics so it'll look grainy. Have you tested this on an iPad 3? This should render correctly for you with the #2x images.

How to support both iPad and iPhone retina graphics in universal apps

Apple presented new iPad that support retina graphics.
I saw this link retina graphic in apple apps. As you can see apple just use "#2x" suffix for retina iPad display.
I have an universal app. So how to support retina in new iPad and iPhone? Will iPad retina use suffix "#2x" similar to iPad?
I just created a test app and tested.
So for devices without retina:
ImageName.png - For iPhone/iPod
ImageName~ipad.png -- For iPad
For devices with retina display:
ImageName#2x.png - For iPhone/iPod
ImageName#2x~ipad.png -- For iPad
And you can still use #2x if your iPhone high resolution image and iPad high resolution image have the same size.
To load the image just use [UIImage imageNamed:#"ImageName.png"];
I just tested it on iOS simulator for iOS 5.1, 5.0 and 4.3.
By the way why you should use #2x and nothing more.
The main thing because you shouldn't use the same graphics on iPhone and iPad, because iPhone and iPad has different size. And if you will use the same size the graphics will already done for you iPad retina display (if you previously use iPhone retina display). If you will images with different size, so you will use different image names for iPhone and iPad. So in this side you need just add #2x suffix.
That's why you should use just #2x suffix. - these are my thoughts.
I found that the iPad mini/non retina iPad hardware, not simulator, would fall back on ImageName.png, not ImageName~ipad.png as you would expect from rowwingman's answer.
Looking at the docs, referenced in another StackOverflow question by Nate, it seems as though appending the device to iphone images is the correct way to do it.
MyImage.png - Default version of an image resource.
MyImage#2x.png - High-resolution version of an image resource for devices with Retina displays.
MyImage~iphone.png - Version of an image for iPhone and iPod touch.
MyImage#2x~iphone.png - High-resolution version of an image for iPhone and iPod touch devices with Retina displays.
Image, Sound, and Video Resources