简体   繁体   English

Android Web浏览器会像iPhone上的Safari一样收缩内容吗?

[英]Does Android Web Browser shrink content like Safari on iPhone does?

I'm creating a mobile version of my website, for iPhone I had to use the metatag <meta name="viewport" content="width=320; etc so that Safari would not shrink the mobile version of my site. 我正在创建网站的移动版本,对于iPhone,我必须使用元标记<meta name="viewport" content="width=320;等等,以便Safari不会缩小网站的移动版本。

I'm just wondering if Android has this same functionality? 我只是想知道Android是否具有相同的功能?
And if so, is there a similar way of telling the browser not to shrink the content 如果是这样,是否有类似的方法告诉浏览器不要缩小内容

(I don't actually have an Android device or simulator to find this out for myself) (我实际上没有Android设备或模拟器可以自己找到)

just download the android sdk ( from here: http://developer.android.com/sdk/index.html ), install it and create an emulator and try it out for yourself. 只需下载android sdk(从此处: http : //developer.android.com/sdk/index.html ),安装它并创建一个仿真器,然后亲自尝试即可。 Should be more than enough to see how the device behaves. 应该足以了解设备的行为。

Android尊重iOS等meta视口指令,是的。

Yes, the Android browser does read meta viewport, and I recommend you change it to this: 是的,Android浏览器确实读取了元视口,我建议您将其更改为:

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

Instead of setting an explicit width based on the resolution one device happens to have, the above tells the browser to use the actual width of the viewport. 上面的内容告诉浏览器使用视口的实际宽度,而不是根据一个设备恰好具有的分辨率设置显式宽度。

该文档对此主题有很多建议: http : //d.android.com/guide/webapps/index.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM