为什么我的字体大小显得那么在Android浏览器中查看时比在Android的WebView对象大得多? [英] why does my font-size look so much larger in the android webview object than when viewed in the android browser?

查看:965
本文介绍了为什么我的字体大小显得那么在Android浏览器中查看时比在Android的WebView对象大得多?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让这些微小的Andr​​oid应用程序,什么也不做的人,但在网页视图对象,而不是浏览显示一个网站,到目前为止,它加载目标网页,但文本和图像尺寸都比当大得多查看页面中的实际设备的浏览器。在浏览器的页面看起来正确,但不是在我的应用程序。

I am trying to make one of those tiny android apps that do nothing but display a website in a webview object rather than the browse and so far it loads the target webpage but the text and image sizes are all much larger than when the page is viewed in the actual device browser. In the browser the page looks right but not in my app.

检查的页面我的桌面版Chrome揭示了CSS使用字体大小6em如果这可以帮助你。

Inspecting the page in my desktop chrome reveals the css is using font-size 6em if that helps you.

当我包括视口元标记它不会做我的应用程序任何东西,但导致浏览器渲染页面更接近web视图对象的方式做:东西看起来太大了。

When I include a viewport meta tag it does not do anything for my app but causes the browser to render the page much closer to the way the webview object does: stuff looks too big.

有没有快速修复(如视口标签设置或web视图对象或websettings上的API调用对象),或者我需要重新设计的CSS,可能不使用EMS?顺便说一句,我没有写网页或CSS。

Is there a quick fix ( eg a viewport tag setting or an api call on the webview object or the websettings object) or do I need to redesign the css, maybe to not use "em"s? BTW, I didn't write the web pages or the css.

感谢。

PS:顺便说一句,我想打的页面是在这里:deltabingo.com/delta-bingo-mobile

PS: BTW, the page I am trying to hit is here: deltabingo.com/delta-bingo-mobile

推荐答案

在浏览器和您的应用程序之间的差异可能是因为你没有设置<一个href=\"http://developer.android.com/reference/android/webkit/WebSettings.html#setUseWideViewPort%28boolean%29\"相对=nofollow> setUseWideViewPort WebSetting 为true。

The difference between the browser and your app is probably because you haven't set the setUseWideViewPort WebSetting to true.

如果页面看上去太大/太小,那么它有可能是视并不是要你希望它是,尝试这样的事情(也许玩的值宽度设置为):

If the page looks too big/too small then it's possible that the viewport isn't want you want it to be, try something like this (and maybe play around with the value width is set to):

<meta name="viewport" content="width=320, initial-scale=1">

另外值得一提的是,该页面在视口中使用目标densityDpi,这不是由KK网页视图的支持。

在这里看到的视口的详细信息: https://developers.google。 COM /镀铬/移动/文档/网页流量/ pixelperfect
http://developer.android.com/guide/webapps/targeting.html

See here for more info on viewport: https://developers.google.com/chrome/mobile/docs/webview/pixelperfect http://developer.android.com/guide/webapps/targeting.html

这篇关于为什么我的字体大小显得那么在Android浏览器中查看时比在Android的WebView对象大得多?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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