iPhone GUI objects migrating position between normal and retina display - iphone

I am developing and app for iPhone which uses graphics for retina and non-retina displays.
Every UIViewController displays both the status bar and the navigation bar.
The views' simulated metrics values are set correctly for the above options.
The issue I am facing is that the buttons are migrating about 30 pixels when the app runs on iPhone 4. The resize settings of all the GUI objects are set to default.
Could you help me with this issue?
Thank you,
Andrei

Are the #2x version of the images exactly twice the resolution of the non-retina versions?
Different sizes can cause the images to change places between displays.
Can you check the value of the frames of buttons both on 3GS and iPhone 4 and see if they are the same?

Related

How do I provide iPad and iPhone 5 versions if I use .xib files?

I have a very simple app that just displays a block of text every time you touch the screen. I have a graphic behind the text, that the basics of it.
I made it back in 2010 using a .xib file to create the text field and the image.
I'm now attempting to make it fit both iPhone 5 and both iPad and iPad Retina.
I can't simply stretch out the existing .xib layout because it just accepts and renders the last one I do. (If I stretch to iPhone 5 resolution it goes off the screen on an iPhone 4S).
Is there anyway to reference different .xib files based on the iOS device?
Thank You.
According to the documentation, you can use:
myNibName~ipad.xib and
myNibName~iphone.xib
and the correct xib will be loaded depending on the device.
You can read iOS Supports Device-Specific Resources.
EDIT:
how do you distinguish between iPhone 3.5" vs iPhone 4.0"
there is no device modifier specific to the iPhone 4". You will have to define your nib in a way that it can "stretch" vertically.
The only mechanism is a iPhone 4" specific Default-586#2x.png file. If you provide it, then the whole screen area will be available to your app.
If you do not provide it, then the app will run in a special mode whereby its content is presented in a 3.5" area. The remaining area is filled with a top and a bottom black band.
iPad vs iPad Retina?
nothing special here, since the 2 devices share the same "logical" resolution of 768x1024 pixels. As usual, you can use #2x modifier to supply specific retina-resolution images; and, if you need it, you can use ~ipad#2x modifier to supply retina iPad-only images.
E.g.:
iconImage.png -> non-retina iPhone version
iconImage#2x.png -> retina iPhone version (also retina iPad version if no ~iPad is given)
iconImage~iPad.png -> non-retina iPad version
iconImage~iPad#2x.png -> retina iPad version
EDIT:
To make your UI stretch, go to the metrics pane in IB and set the vertical spring for the view height (this is the inner vertical double arrow in the picture below).
You will have to find your way through this a bit, especially if you have a lot of subviews.

iPhone 5 app compatibility, Is it mandatory to change all the images?

I want to make my App compatible for iPhone 5, i got the point about auto resizing just need to confir, Do i need to add all the images re-sized for iPhone 5 OR can work with re-sizeing only Splash and Background image ?
You will be required to resize the launch images. You need a launch image for the older iPhone screen sizes in normal and retina resolutions as well as an iPhone 5 screen size retina image.
It will be a good idea to rework your app and have background images that can take advantage of the larger iPhone 5 screen size, but will be able to be cropped and still work on the older iPhone screens.
Using either auto layout or setting the resize and pinning struts properly, your other controls and images should be able to be used as they are to adapt your app to look good on the iPhone 5 screen.
You only need to resize the splash screen.

convert images iphone to ipad

I am just finish my app for iPhone, now I have to convert it for both iPhone and iPad. I can check the device on runtime. but the problem is that. I don't know what should be size of custom navigation bar (320 * 44 I used in iPhone) ,custom tab bar (320 * 44 i used in iPhone), buttons,table background and my more images size for iPad.
I googling but not get the perfect answer in one place. till now i understand only that image name concept
devices without retina:
ImageName.png - For iPhone/iPod
ImageName~ipad.png -- For iPad
devices with retina display:
ImageName#2x.png - For iPhone/iPod
ImageName#2x~ipad.png -- For iPad
can any one provide me links from where I get the all information about image size and resolution for iPad and retina display. like splash screen , icon size , navigation bar size, tab bar size, manage custom images for buttons for both iPhone and iPad etc
It is hard to describe my all image size and resolution problem in this question, but hope you guys understand my problem
Many Thanks.
Here you go, from the Apple Developer Documentation: Custom Icon and Image Creation Guidelines
Also: App Icons on iPad and iPhone

App running on iPhone 4 has a 320x480 resolution instead of 640x960

I'm creating an iPhone app, which will run on iPhone 3 and iPhone 4.
To that point, I was trying to make the images adjust to the resolution, but it turns out that even when running on the iPhone 4, the size of my window is 320x480.
On the XIB I specified "fullscreen at launch" and for the ViewController I even specified "Wants fullscreen", but I can never get it to recognise the actual resolution.
Am I missing something?
Is it running full screen on your iPhone 4? (I don't mean what resolution is being reported, I mean are there black bars around the app - I bet there aren't).
iOS is 'magical' in that you just deal with iPhone 3 size things i.e. xibs etc and it scales it correctly for you on the iPhone 4. You will always see the smaller resolution when you query the display.
To get images to load the correct resolution just create two versions i.e.
myImage.png
myImage#2x.png
Make the second one exactly twice the size of the first and the iPhone will do the rest.
PS There's a property that's been added to UIImageView called scale - it's how the iPhone knows how large to render an image - have a look at the docs here.

What resolution should I make my image backgrounds for my universal iOS app so that it supports the Retina display?

I have a universal iOS app with a custom view that has three buttons, each with an image background that extends to the sides of the screen for each orientation (portrait and landscape). The heights of each of the three buttons are the same and all three buttons take up the whole screen. So it looks simliar to this layout (image on the far right).
Since the widths and heights of each button are the same, I need to calculate how big (in pixels) I need to make each button image in order to support both orientations of the iPad and iPhone. On top of that, I also need to create higher res images to support the new Retina display. My questions are...
How do I calculate the resolution these images need to be for...
iPad in both portrait and landscape mode
iPhone in both portrait and landscape mode
iPhone with Retina display
Instead of having two sets of images to support both Retina and non-Retina displays, can I just use one hi-res set that will be scaled down to the non-retina displays? if so, is this a good idea?
If I add a navigation controller and/or a toolbar, what are the heights of these two view objects so I can adjust the heights of my images?
Thanks so much in advance for all your help! I'm going to continue searching for these answers right now.
Good info on porting apps / graphics to retina display is here
Essentially Apple created a new unit for graphics called "points" and if you add additional images to the bundle and use new API you can automagically load one or the other image.