Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone screen resolution changes in future hardware

Something I've been concerned about for a while as I'm developing my applications is the oft hard coded geometry of images and view components that take for granted the 320x480 nature of the current display generations.

I've seen many answers in StackOverflow and in examples / tutorials that hard code in the screen dimensions. I've made some textures for backgrounds that are 320x480 in size as well, but am careful to make them UIViewContentModeScaleToFill, but I am not entirely positive that pixel positioning in the IB will result in hardware specific interfaces.

At some point I imagine (and hope!) that the iPhone will have different display resolutions.

  • Are you as developers planning for this?

  • What are you doing to account for variable screen resolutions in the future?

(Assuming of course that someone would want more than 640kb, oh sorry, 320x480 resolution :))

Please see this URL: http://developer.apple.com/iphone/library/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/SupportingResolutionIndependence/SupportingResolutionIndependence.html#//apple_ref/doc/uid/TP40007072-CH10

For iOS4 answer from Apple.

like image 579
groundhog Avatar asked Aug 10 '09 15:08

groundhog


People also ask

Which iPhone has a screen resolution of 414x896?

The iPhone XS Max measures 6.5” and the DPR is 3 again. Therefore, the logical resolution is 414x896 and the hardware resolution 1242x2688.

What is the iPhone screen ratio?

However, a modern iPhone has an aspect ratio of 19.5:9 and an iPad has an aspect ratio of 4:3. The reason why aspect ratio is important is because, while you can scale your images to fit the screen, you have to scale them the same amount horizontally and vertically. Otherwise the images look distorted.


2 Answers

You might want to check out NSScreen for OS X and UIScreen for iPhone.

From the documentation:

"...you should use the properties of this object to get the recommended frame rectangles for your application’s window."

like image 189
Gordon Potter Avatar answered Sep 21 '22 06:09

Gordon Potter


You should be. If there is a way to retrieve those metrics from the API, you should. Back in the old days of the mac, lots of poeple hard coded for the the 9" screen. When I got my mac XL (essentially a lisa case with a mac main board inside) it has a 12" screen and the number of "broken" apps that didn't scale was legend.

Short of it is that if there is going to be some radical change in the hardware, Apple will surely do it. Any company that can successfully change chip platforms TWICE has no fear in updating hardware, software and whatever else to make things better.

like image 43
MikeJ Avatar answered Sep 21 '22 06:09

MikeJ