ygo*_*goe 25 html scaling android viewport
我编写了一个小型Web应用程序来收集一些数据并将其存储在中央数据库中.我走来走去,阅读价值观并在我的Android智能手机上输入网站.这只适合我,因此这次没有适用的公共可用性问题.
现在我想添加一个按钮来增加一个读数,我需要能够多次按下该按钮.但是,如果我执行得太快,浏览器会识别双标签并缩放/缩放到页面中.
我已经添加了一个视口标题,并且可以使用我在网络上找到的每个值组合.但页面仍然可扩展.我怎么能阻止它?
这是一个对我来说失败的最小测试页面:
<!doctype html>
<html>
<head>
<title>Test page</title>
<meta name="viewport" content="width=device-width, user-scalable=no" />
<style type="text/css">
body
{
font: 16pt sans-serif;
}
</style>
</head>
<body>
This is a test page. It should not be scalable by the user at all. Not with the two-pinger pinch gesture and even less with a double-tap on the text.
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
添加initial-scale = 1,maximum-scale = 1和各种target-whateveritwas-dpi不会改变事物.我已重新启动浏览器(Dolphin HD和股票浏览器)并已清除缓存.我在Android 2.2上,手机是HTC Desire.
Rub*_*nsh 46
这适用于所有Android浏览器:
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
Run Code Online (Sandbox Code Playgroud)
一个常见的错误是人们使用2个元视口标签,如下所示:
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0' name='viewport' />
<meta name="viewport" content="width=device-width" />
Run Code Online (Sandbox Code Playgroud)
第二个元视口标记覆盖了某些浏览器中的第一个(例如 - chrome for android).没有理由有两个元视口标记,因为第二个包含在第一个视图标记中.
有关详细信息,请参阅此答案
Had*_*des 12
这是Android浏览器中的一个已知错误:http://code.google.com/p/android/issues/detail?id = 11912