My app's icon is named:
appicon57x57.png
This works great on simulator and device. I don't have a retina device to test on. But if I make a 114x114 version of my app icon and call it:
appicon57x57#2x.png
and put in in the same place as the other icon, will it show on the retina devices?
As long as your Info.plist lists the app icon name as appicon57x57 (as it should since you say it works), and you make sure to add the appicon57x57#2x version to your project (and its build target), then yes, Retina Display devices should detect the appicon57x57#2x version and load that one.
Related
I program for both iPhone and iPad. When doing iPhone stuff, I prefer the retina iPhone simulator. When doing iPad stuff, I prefer the non-retina simulator. Swapping between them is a two-step process for me. I have to switch xCode from the "iPhone simulator" target to the "iPad simulator" target. The problem is that when I do this, the simulator switches from retina iPhone to retina iPad. I therefore also have to go into the simulator app and change the hardware to non-retina iPad.
Is there a way to accomplish that in a single step?
Yes! and its super easy. In Xcode 4+ click the dropdown with the name of your target in it in the top menu bar next to the play button. Then click edit scheme.
Click the run action and then click the Options tab. You will see you can specify the type of screen you want to use when you click the play button (build and run) in Xcode.
Then when you switch device target in Xcode it will automatically switch the simulator to the right device and screen type for you.
Also if you're running less than iOS 5.1 the simulator will switch back to non-retina. Set SDK to 5.1+
Initially I developed my app as Universal. Then I designed splash screens separately for iPad. Recently I decided to deploy my app in iPhone device mode only. My app has no fancy graphics and it just looks well and works perfect on iPad either in 1x or 2x mode.
To do so I set Devices to iPhone at TARGET/Summary/IOS Application Target pane. I dragged new splash images I created for iPhone into Launch images placeholders, one for non-Retina and one for Retina displays.
However when I launch my iPhone app on the iPad, either through debugger or stand alone, the old iPad splash screens I no longer use come up. They look bad because the image centre appears to be moved down-right as they were originally created for iPad.
I went back to XCode and momentarily changed the Device type to Universal or iPad. I deleted the images both from Launch images placeholders and physically from the file system.
Unfortunately the iPad splash images I created earlier still come back when I build my app in iPhone device mode and deploy it on my iPad. How can I get rid of them once and for all and get the app use the iPhone launch images I created and setup recently?
If you deleted the images from the disk, Clean all targets (in Xcode Product->Clean) and rebuild. There should be no way after doing this that the old image will appear (if it does it means it was not deleted properly from your project).
Clean your project (Command+Shift+Option+K)
Close Xcode, go to ~/yourCurrentUser/.Library/Developer/Xcode/DerivedData
Find the folder for your project, and delete it.
Delete the app in your simulator or test device.
Now build and run the app, and that must work; if not, delete the final images once more, and repeat the above steps.
Don't forget to check your info.plist file for Icon Files key. Sometiems splash screen images get added to the Icon Files key for no clear reason! You must remove them from there.
I have a quite simple question concerning the difference in screen size between the iPhone 3/3GS and the iPhone 4. I've googled around, but was unable to come up with a good explanation.
Here's the thing: tabbar icons. All my icons are 30x30 and 60x60. I named the high resolution ones like [icon]#2x.png. When I load my app on my own iPhone 3GS, all goes fine. But when I load the app in Simulator, simulating a 4 with retina-display, the icon looks pixelated and is clearly the wrong resolution.
What am I doing wrong? These were the exact steps I followed, but I'm probably missing something. Is there something like an option I need to set in the plist?
Any help is greatly appreciated!
Kind regards,
Reinder
You need to name the icons as you have and edit your plist file
The following link should help
http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html
Make sure you clean and build and remove the existing application from your phone and the simulator to see the results
The complete set of icon sizes distilled is
Icon.png – Home screen icon for iPhone 3 (57×57)
Icon#2x.png – Home screen icon for iPhone 4 (114×114)
Icon-72.png – Home screen icon for iPad (72×72)
Icon-Small.png - Settings/Spotlight icon for iPhone 3 (29×29)
Icon-Small#2x.png – Settings/Spotlight icon for iPhone 4 (58×58)
Icon-Small-50.png – Spotlight icon for iPad (50×50)
iTunesArtwork – Icon for iTunes AdHoc distribution (512×512)
It seems that you're doing it the right way. Did you try to remove the app from the simulator? Clean up the project? Re-import the icon image files?
Try (with the simulator stopped) cleaning all targets and re-building. Sometimes xcode gets dumb about what files it's got and needs to be told to clear its cached build and start fresh. It's in the "build" menu, or ctrl-shift-K.
I am planning an app for iphone 3g, 3gs and iphone 4. I have a 57*57 image for 3g and 3gs. When I checked documentation apple suggests us to use a 114*114 image for iphone 4. So how can I support both the images with the same build.
Use the CFBundleIconFiles property in your Info.plist and supply two icons, you name the high-resolution one with an "#2x" suffix so the iOS knows it's the high-resolution icon to use on iPhone 4. You can also specify iPad icons (for apps that run on iPhone and iPad) using the same property. This is documented here: http://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/BuildTimeConfiguration/BuildTimeConfiguration.html
Call the iPhone 4 icon Icon#2x.png
http://developer.apple.com/library/ios/#qa/qa2010/qa1686.html
You have to list all your icons in your Application's plist, and name the ones for iPhone 4 "Name#2x.ext" (add '#2x' to your file's name).
If you place the original icon and an icon with the same name but add #2x to the end of the name in your resources folder the correct one will be used automaticly.
The collection of different possible icon sizes for iOS is getting pretty long now. But all you need to do is to list all of the files in your app's Info.plist in the CFBundleIconFiles key, and the OS will do the work of picking the correct size.
Which part of the app is it that "triggers" the iPad app as it's own app as opposed to running the iPhone version in a universal binary?
What do I need to change to make my app Universal, after clicking "Upgrade current Target for iPad"? My app runs on outside of the simulator, but my images are too small and my text is out of place. What am I missing here?
To the opposite end, how do I force my Universal app to run as an iPhone app inside the simulator on the iPad? (When changing "Target Device Family", it will run the iPad version of the app in the simulator, but not the iPhone version.)
EDIT:
It seems to me that these questions kind of complement each other. While I suspect it's the same mechanism at work in both situations, I'm not sure what it is, or how it works.
There are keys in the info.plist file put there by the Targeted Device Family setting. The iPad looks for those plist keys to determine whether to launch as a Universal app or in iPhone emulation mode, and which idiom's xib files to use for app launch.
Added:
If you don't have, and specify in the plist, a .xib file suitable for the iPad idiom, then one with the wrong UIWindow frame is used, which ends up in the upper left corner.
You need to re-code the app for the iPad to lay out your text and images how you want them when it is running on an iPad.
To make it run as an iPhone app you stop it being Universal.
The build setting is called Target Device Family
That's where it starts.
If you wrote a universal app and you want to force the iPhone mode on the iPad you switch Target Device Family to iPhone only and it will ignore everything else.