Images for retina display iphone - iphone

I have an working application which i have tested in my ipod touch. Everything works pretty fine.
My tabbar icons and splash screen images are in a separate folder in my Resources folder
Resources->images
Now, I know for iPhone4 i need to use 2x images.
My question is for support for iPhone4 all that i need to do is add 2x images in my images folder. For example if my splashscreen image is Default.png, I should add my 2x image as Default#2x.png in my images folder and iphone will use it automatically.?
Is it the same for all tabbar images ?
Thanks in advance

Yes, all that you said is correct. Remember to also import the #2x images into your Xcode project (e.g. by dragging them from Finder to Xcode), so they'll be added to the bundle when you build your app.

For the apps I have worked on, I have only one image in this format:
myImage#2x.png
When I reference this image, I make the following call and it always works, whether on a 3GS/iPhone 4 or iPad.
[UIImage imageNamed:#"myImage.png"]

Related

How to add seperate iPad and iPhone images in spritebuilder- Cocos2d 3.2

I love that Spritebuilder takes the retina iPad image and automatically makes the scaled down iPhone images.
I make one image (ipad retina), And spritebuilder makes the iPhone ones automatically:
But for certain buttons/sprites, I wanted to make both the iPad and iPhone images myself. How do I add custom iPhone AND iPad versions for an image that can be used in the Spritebuilder UI?
Eg. Use one image for iPad (retina), But use another one for iPhone.
Also, how do I add something like an external spritesheet into my Spritebuilder XCode project? (Adding the -hd or -ipadhd suffix no longer works, it just always chooses the one with no suffix) -I heard is has something to do with 'resources-phone'?
If you select an image in SB you can see its preview image in the top half of the file view. Below the image are 4 smaller buttons labelled auto, one for each platform (phone, phonehd, tablet, tablethd).
For instance, select your ipad image, then drag and drop another image to that image's phone and phonehd auto buttons. That way they override the original image when the app is run on a phone or phonehd device.

Migrated to Asset Catalogs for launch images. Simulator shows black screen

Upgrading my project to Xcode5.
I've filled out the launch images asset catalog. However when running in the simulator, my launch images don't show for iPhone retina and retina 4-inch. Just a black screen before loading the app.
I've tried Product > Clean. Any ideas?
Double check the sizes of your images in xassets. I had the same problem and once sizes were right launch displayed. Also make sure name of file that includes #2x was changed before adding it to Xcode not while in Xcode.
My Retina size was 640x1136 and 2x size was 320x568. I got a compiler warning and changed the latter image to 640x960 and launches appeared instead of the black screen.

How to add these three files properly?"Default.png, Default-568h#2x.png, Default#2x.png" for universal app for iPhone/iPad?

I added "Default.png, Default-568h#2x.png, Default#2x.png" these three files in my universal project for splash image, I have three diffrent image and the resolution exactly the same as mention in apple docs, for iPad 768 * 1024 , for iphone-4s -> 320 * 480 , for iphone 5-> 640 * 1136.
But my problem is that when I rum on iphone4s- iphone5 the splash rum properly, but when I run on Ipad the Deafault.png splash not showing instead of it takes reference from Default-568h#2x.png. The Default-568h#2x.png is showing on the iPad instead of Deafault.png and the image got blur and shrink on ipad also, beacuse Deafault.png not showing. How to slove this problem.
Any Idea or suggestion from experts would be highly welcome.
Launch image naming should be similar like this for universal application.
iPhone > Default~iPhone.png,Default#2x~iPhone.png & Default-568h#2x.png.
iPad > Default-Portrait~iPad.png,Default-Portrait#2x~iPad.png,Default-Landscape~iPad.png,Default-Landscape#2x~iPad.png
Please refere the following link for more details regarding image resolutions
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html
and for image naming conventions use the following link
http://developer.apple.com/library/ios/#documentation/iphone/conceptual/iphoneosprogrammingguide/App-RelatedResources/App-RelatedResources.html
First I would like to suggest that,
Preapre all Images,
Select Project from Project Navigator And Go to Summary and scroll down this
screen appears, then right click on that and choose file from your
computer it will automatically copied to project and it will entered
in plist file also..
if your application is universal then you have
to set for iPhone and iPad Both.
`
See the offical document at chapter App Launch (Default) Images:
App Launch (Default) Images
Only you should do is set the launch image a proper name with relative size, then add those images to the project. Xcode will help you to display it correctly when app launching.

Retina images (#2x~ipad) not loaded if iPad image doesn't exist (~ipad)

I have something strange in my app.
If in the ressources I have 2 files named : myFile~ipad.png and myFile#2x~ipad.png the retina image is loaded on iPad retina as it should be.
But If i have two files named myFile.png and myFile#2x~ipad.png, the retina images is never loaded and myFiles.png is used for all devices.
Is this normal ? The problem is that I want to use the image myFile.png for iPhone, iPhone retina and iPad and the image myFile#2x~ipad.png for iPad retina so I can't put the extension ~ipad beyond myFile.png.
Use symlink. I just google it, and didn't say it couldn't be done, but most of it points to symlink in an SD card.
You can have the same image "myFile.png" with different name as myFile~ipad.png so that you can have same result for iPhone, iPhone retina and iPad. And "myFile#2x~ipad.png" image for ipad retina display.
hope this will help.
We tried using symlinks, but it turns out that in the built app, the symlinks actually turned into copies of the images they linked to. Xcode resolves symlinks by copying the source file. So you can use symlinks for convenience, but not to save storage space in the built app.

PhoneGap iPad lauch screen does not fit

I created an App which is compatible to iPhone and iPad. Because it is based on HTML (PhoneGap) the App itself is the same for both devices (HTML scales well!). But the launch screen image does not fill out the display on the iPad upon launch.
In my Resorces folder there is only the iPhone launch image which is to small for the iPad, how can I add an other one for the iPad?
You need to specify the launch image file (UILaunchImageFile) property in your application's info.plist:
For example, if you set the value for the key UILaunchImageFile~ipad to iPad, your file names should be iPad-Portrait.png and iPad-Landscape.png. You could similarly change it for the iPhone, or use the default (Default.png) for iPhone.
This is defined in Information Property List Files.
Hey, I've found a solution to this issue, using phonegap 1.9 dropping this code into your apps delegate should do the trick:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
UIImage* image = [[UIImage alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:#"Default-Portrait" ofType:#"png"]];
imageView = [[UIImageView alloc] initWithImage:image];
[image release];
imageView.tag = 1;
[window addSubview:imageView];
[imageView release];
}
That needs to go in the 'applicationDidFinishLaunching' function after the [ super applicationDidFinishLaunching:application ] call.
You need to specify the launch image as mentioned above, but also check to make sure that after the build your launch icons are in the right place. After doing a Build/Run of a PhoneGap project, check the Resources folder in xcode. I found that my additional launch screens and app icons hadn't been moved there in build. Once I copied them in manually and re-built, all the icons and launch screens worked as they should for ipad and iphone.
I had the same problem. I tried a whole bunch of solutions, which were proposed here and on the net. Nothing worked. My Problem was that I'm using a deployment target < iOS 3.2 which does not support the Info.plist settings Mo. described in his post.
Unfortunately Apple has several documentations on the Info.plist / splash screen matter. This one helped:
http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html#//apple_ref/doc/uid/TP40007072-CH7-SW18
You set up your project like this:
Make no "Launch image" settings in Info.plist. Just add the following images:
Default.png --> This is the (big) iPad splash image
Default-Landscape.png --> This is the (big landscape) iPad splash image
Default-Portrait.png --> This is the (big portrait) iPad splash image
Default~iphone.png --> This is the (small) iPhone splash image
To support high-resolution displays:
Default#2x~iphone.png --> --> This is the (retina) iPhone splash image
you need to put a file called "Default.png" in your resources - splash folder. This will remove it, yes i know it sounds silly, because it's an IPAD app, but if you don't want to touch the C code, just add or replace that file. It get's called even if it's an IPAD (meaning, actually default.png is for iphone, but ...well whatever, just try it!)
I followed the documentation regarding adding the UILaunchImageFile key to the .plist file http://developer.apple.com/library/ios/#documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html .
This works but you have to remember to drag and drop your ipad image into XCode. It will not work by simply adding the file in the file browser, you must use Xcode!