Why is the iphone view size is set to 480 - iphone

When I use interface builder i see that the size of the view is 480X300 why is that? isnt the iphone screen 960X640px?

These are actually "points". Depending on UIDevice scale parameter points convert to either 480*320 (for normal display) OR to 960*640 (for retina display).

You can also read the Apple docs which explains the difference between points and pixels in detail: Points Versus Pixels

And also note that the "missing 20 pixels" (300 instead of 320) are due to the status bar. If you select "status bar unspecified" in "simulated user interface elements" in the CMD-1 attributes inspector then you get the full 320 height.

Older iPhone (like iPhone 3GS) has 480x320 display, and iPhone 4 has 960x640 display (called retina display).
On the retina display, any user interface elements will be scaled up to 2X.
By the way, these are not "points", but just "pixels". If they were "points", iPhone 4 would be bigger than iPad.

To understand how to handle screen/display size depending on iPhone versions, read this article : Supporting High-Resolution screens

Related

Desiging Websites for Retina style devices: What dimensions should you use when designing?

The dimensions of the iPhone is 320x480
The dimensions of a Retina iPhone is 640x960
When designing a design for a retina device, do you set the size of your document to 320 x 480 or 640 x 960?
I would have thought you would have set the size to 320 x 480.
The reason for this is that although a retina device has more pixels, these are still being displayed on a 3" screen size. If you did set your size to 640 x 960, then when viewed on a retina display, all the text would be small, as although there are more pixels, the screen isn't physically bigger.
Is that correct?
UPDATED: Do you also use 320 x 480 as a base size for CSS (see comments below)
Yes, that's correct. I'm an iOS developer, not a web designer, but in iOS devices you specify everything in points (which is one pixel on a non-retina device, and a 2x2 pixel block on a retina device) so everything is the same size. The extra pixels on the retina display simply make everything look better.
You can get away with smaller text on a retina screen since you have more detail, but accessibility wise that's not a good move, since lots of people can't then see your text without zooming, whatever kind of display they have.

iPhone GUI objects migrating position between normal and retina display

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?

Best way to set the size of UIViews size in iPhone application (so everything looks good on both Retina and older display)

I have the following problem. My application has a tab bar at the bottom and a simple TextView above. In order to fit well TextView above tab bar I had to resize it (I did it through Interface Builder) - I just set height to 401px (usually I hate to do such things).
Then I have tested application on the simulator, to my surprise everything looked o.k. on both standard iPhone display and Retina display. Since I do not have an iPhone I am wondering if everything would look good on the real device as well.
So, my question is: how to set the UIView size so it follows best practices and, what is more important, GUI looks good on both Retina and older display.
BTW: I know how to deal with icons and graphics to make them look good on Retina and older display, I've read all the relevant stackoverflow posts on the subject :)
Size is same on both standard and retina display. It's measured in points. Number of pixels depends on display density.
Pixel != point.
Look at UIScreen scale property. For standard screen it contains 1.0 and 2.0 for retina (iPhone 4). It can contain different values, even not integers.
If you set size UIImageView size to 100x100, it will have same physical size on standard and retina display. But on retina, it will show you much nicer image, because 100 points contains more pixels.
The units in Interface Builder are now interpreted as points not pixels. Therefore it will look the same on both types of displays. On old displays 1 point equates to 1 pixel. On Retina displays 1 point equates to 2 pixels.

When I create an iphone window based app, how to tell interface builder create window for retina pixel size?

I hope to create an iphone window based app for retina screen?
But I found that the size of window in mainwindow.xib is fixed.
How to adjust it or there is any to tell interface builder create window for retina pixel size?
Welcome any comment
Thanks
interdev
There's no need to do anything in terms of the various components you layout in Interface Builder, as it's based around points, not pixels - and as all the iPhone screens sizes are the same in points no action is required.
In terms of any images you're loading, you will need to supply higher resolution (twice the pixel size) versions, but as long as these are named "[original name]#2x.[extension]" they'll simply work automatically.
For more information on the image naming, see the "Specifying High-Resolution Images in iOS" section of the Resource Programming Guide and if you want to delve a little deeper, there's a discussion on "Points Versus Pixels" within the Drawing and Printing Guide for iOS.
UPDATE - As of the iPhone 5, the iPhone screens are no longer all the same point size. :-)
The window will be automatically resized for you, you do need concern about the size of your image elements, since retina display uses a bigger size of resolution. You need name your images like this:
regular image name: myimage.png
retina image name: myimage#2x.png
When running in an iPhone4 your program will identify the token "#2x" and change the images for that kind of device.
Design your layout using the size of: 640x960 (double of the original: 320x480)
Good luck.

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.