Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to accommodate for the iPhone 4 screen resolution?

People also ask

Can you adjust iPhone screen resolution?

In case you want to enter custom resolution you have to do it manually, by going to Settings> Upscale in the lower section, you can enter your custom resolution in the “x” and “y” sections.

Which resolution is best for iPhone?

Your iPhone can record at 720p, 1080p and 4K. For the absolute best video image quality, 4K resolution is the best choice. If you don't care about quality as much and are more focused on how much room on your phone videos will take up, try dropping your resolution down to 1080p or even 720p.

Where do I find the resolution on my iPhone?

Besides processor, memory or battery usage graphs, it can also tell you what resolution the display has. To find this information, open the app's menu and navigate to This Device -> Display. That is the place where you find your iPhone's or iPad's Screen Resolution.


According to Supporting High-Resolution Screens In Views, from the Apple docs:

On devices with high-resolution screens, the imageNamed:, imageWithContentsOfFile:, and initWithContentsOfFile: methods automatically looks for a version of the requested image with the @2x modifier in its name. It if finds one, it loads that image instead. If you do not provide a high-resolution version of a given image, the image object still loads a standard-resolution image (if one exists) and scales it during drawing.

When it loads an image, a UIImage object automatically sets the size and scale properties to appropriate values based on the suffix of the image file. For standard resolution images, it sets the scale property to 1.0 and sets the size of the image to the image’s pixel dimensions. For images with the @2x suffix in the filename, it sets the scale property to 2.0 and halves the width and height values to compensate for the scale factor. These halved values correlate correctly to the point-based dimensions you need to use in the logical coordinate space to render the image.


This is purely speculation, but if the resolution really is 960 x 640 - that's exactly twice as high a resolution as the current version. It would be trivially simple for the iPhone to check the apps build target and detect a legacy version of the app and simply scale it by 2. You'd never notice the difference.


Engadget's reporting of the keynote included the following transcript from Steve Jobs

...It makes it so your apps run automatically on this, but it renders your text and controls in the higher resolution. Your apps look even better, but if you do a little bit of work, then they will look stunning. So we suggest that you do that

So I infer from that, if you use existing APIs your app will get scaled up. If you take advantage of new iOS4 APIs, you can get all groovy with the new pixels.


It sounds like the display will be ok but I'm concerned about the logic in my game. Will touchesBegan positions return points in the new resolution? The screen bounds will be different, these types of things could potentially be problems for me.


Scaling to a double resolution for display purpose is straight forward, but will this scalling apply to all api's that input/output a screen coordinate? If not things are going to break aren't they?

Fair enough if it's been handled extensively throughout the framework.. I would imagine there are a lot of potential api's this effects.


For people who are coming to this thread looking for a solution to a mobile web interface, check out this post on the Webkit blog: http://webkit.org/blog/55/high-dpi-web-sites/

It seems that Webkit has solved this problem four years ago.