开发者

How can i make my canvas area fit to the iphone browser?

I ve created a game using HTML5. the canvas size is 320x480. When the webpage opens in the browser of an iphone the canvas 开发者_Go百科area will be placed in the left top corner of the browser and unless i zoom it i cannot play the game. What is that i can do .. please help. Thanks.


You need to set the meta tag for viewport to the size of the iPhone screen.

<meta name="viewport" content="width=device-width; height=device-height; initial-scale=1.0; maximum-scale=1.0;"/>

This will scale the page correctly so that you do not have to zoom in at first, and will prevent the user from scaling after the page has opened.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜