手机网站:方向变化,从纵向到横向 [英] Mobile Website: Orientation change from portrait to horizontal

查看:150
本文介绍了手机网站:方向变化,从纵向到横向的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个移动网站为iPhone和Android浏览器。

I'm developing a mobile website for iPhone and Android browsers.

当我与iPhone 4和HTC Desire的玩弄我发现两台设备上的方向变化做出不同的反应。如果我负荷在纵向模式的网站,然后旋转装置水平模式中,IPhone缩放接近内容使用相同的宽度(320px的)。随着Android设备,如果我旋转似乎视口的变化,所以没有任何缩放回事(宽度> 320PX),而不是网站变宽。

As I was playing around with an Iphone 4 and a HTC Desire I found out that the two devices react differently on orientation change. If I load the website in portrait mode and then rotate the device to horizontal mode, the Iphone zooms closer to the content using the same width (320px). With an Android device, if I rotate it seems that the viewport changes, so there isn't any zooming going on (width >320px), instead the websites gets wider.

我目前的视窗(我已经尝试设置的320px的固定宽度):

My current viewport (I already tried setting a fixed width of 320px):

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

现在我的问题:有没有一种方法,使Android的WebKit浏览器放大如iPhone上的方向变化,从写真到水平

Now my question: Is there a way to make the Android Webkit browser "zoom in" like an iPhone on orientation change from protrait to horizontal?

非常感谢你提前!

安德鲁

推荐答案

该链接可以帮助: http://davidbcalhoun.com/2010/dealing-with-device-orientation

这篇关于手机网站:方向变化,从纵向到横向的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆