Understanding iPhone Resolution

I use phonegap to export a very simple html5 page to an iphone app and it works in this silly problem.

IPhone resolution is 960x640.

When I set the canvas to these sizes, it seems too big.

<canvas width="960" height="580" style="background-color:#607559"></canvas> 

Why? And how can I use all the features of the high definition iphone4. It seems that the canvas is suitable for full screen mode if I set the canvas to something on an older iPhone (320x480).

Setting visibility to something like this seems to work, but will it be a performance hit?

 <meta name="viewport" content="width=device-width, height=device=height, initial-scale=0.5, maximum-scale=0.5, minimum-scale=0.5, user-scalable=no" /> 
+7
source share
2 answers

It depends on which iphone you're talking about.

The old iPhone 3GS has a resolution of 320x480. The new iPhone 4 and iPhone 4 have a so-called retina display, which has a resolution of 640x960, but it automatically scales (you do not get access to pixels independently.

But you can set the pixel ratio of a device that is very well covered with canvas in this question: Canvas drawing and Retina display: doable?

+4
source
+2
source

All Articles