的Andr​​oid的WebView window.innerWidth快到313 [英] Android WebView's window.innerWidth is coming 313

查看:164
本文介绍了的Andr​​oid的WebView window.innerWidth快到313的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有JavaScript的一个简单的WebView启用。而且我里面​​加载一个网页。页面有一个JavaScript函数发射的window.innerWidth和window.innerHeight。当我在Nexus One上运行此,innerWidth和innerHeight来了313x533。但是,当我在加载Android浏览器在该网页,然后他们来了320x452。结果我无法找到任何合理的解释。在我的html页面我已经宣布下列视结果< META NAME =视口CONTENT =WIDTH =设备宽度,初始规模= 1,最大规模= 1,用户-scalable =无/>

I have a simple webview with javascript enabled. And I am loading a web page inside that. Page has a javascript function which emits the window.innerWidth and window.innerHeight. When I run this on Nexus one, innerWidth and innerHeight are coming 313x533. But when I load that page in android browser then they're coming 320x452.
I couldn't find any reasonable explanation for that. In my html page I have declared the following viewport.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />

推荐答案

尝试这样的:

mWebView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);

这篇关于的Andr​​oid的WebView window.innerWidth快到313的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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