iphone - android 和 webos 没有内容缩放?

标签 iphone android css webos

我目前正在构建一个针对移动设备优化的网站。

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

我有一个动态 javascript 网格,我不希望在移动设备上进行缩放。

上面的行在 iphone 上完美运行,但我认为它不适用于 android 或 webos。我怎样才能为这些移动设备设置 NO-SCALE 模式。所以没有双指缩放并且设备宽度是 100% 浏览器宽度?

最佳答案

根据 http://developer.android.com/guide/webapps/targeting.html#Metadata ,“user-scalable”属性需要设置为“no”,而不是0。所以:

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

编辑:页面底部附近的更多信息 Safari Reference Library - Supported Meta Tags :

user-scalable
Determines whether or not the user can zoom in and out—whether or not the user can change the scale of the viewport. Set to yes to allow scaling and no to disallow scaling. The default is yes.

Setting user-scalable to no also prevents a webpage from scrolling when entering text in an input field.

Available in iOS 1.0 and later.

关于iphone - android 和 webos 没有内容缩放?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4402844/

相关文章:

Android:通过单击按钮增加和减少 textview 的 int 值

css - Google Chrome devtools 中的交叉样式属性是什么意思?

iphone - 无法获取自定义 rightBarButtonItem

ios - 如何升级使用迦太基安装的现有框架

ios - #define 在 Objective-C 的头文件中

iphone - 如何在表格 View 中的两个单元格之间留出空间?

android - 命令调用失败 : : Unable to forward network traffic to device in Unity

java - 将另一个 Activity 中的项目添加到 ExpandableListView

CSS 边框图像不适用于 IPAD

android - 在全屏模式下显示状态栏 Ionic for android 和 iOS