views:

169

answers:

2

Does anyone know where the various screen dimensions are for the iPhone4? I have checked the MobileHIG but alls I could find where references back to the old iPhone3G. Should I just assume that all previous values are doubled (i.e. StatusBar = 40 pixels), or is there a more accurate illustration (like the one below hidden somewhere else?

alt text

Cheers Gary

+1  A: 

You shouldn't really assume anything about the screen dimensions. If you need the dimensions, read them vie the API.

There is no promise that dimensions or even proportions will stay the same forever. (The iPhone, iPad and new iPhone all have different resolution size and proportions.)

That said, the dimensions on the iPhone 4 should be exactly twice the dimensions of earlies iPhone models.

geon
+3  A: 

Points are the new pixels.

You keep working with the values you're used to, just like if you were still developing for 3G / 3Gs. The unit of these values is now called points instead of pixels, to avoid confusion. On the older iPhone models, a 2x2 point square equals 2x2 pixels on the screen. But on iPhone 4 the same square equals 4x4 pixels. UI elements are rendered at the appropriate resolution automatically, images and other content you provide will be scaled, unless you provide high resolution versions of those ressources.

You might want to read this document for further information.

Toastor
Hi, I see, but what if you want to make maximum use of the current hardware and add a UIImage that fills the whole screen except the status bar? your going to need to know how big to make that image in Photoshop.
fuzzygoat
Yes, that's true. For that purpose you just double the width and height element, measured in points. Example: without the status bar, the screen measures 320x460 points. So, for the background you need two images: background.png (sized 320x460 pixels) and [email protected] (sized 640x920 pixels). You select the smaller version in interfacebuilder or within the code, iOS automatically selects the appropriately sized file at runtime.
Toastor
Ah, I get it, many many thanks, much appreciated.
fuzzygoat