Phonegap 应用程序文本和布局太小 [英] Phonegap Application text and layout too small
问题描述
我最近使用 html、css、javascript 构建了一个 android 应用程序,并通过 phonegap 运行它们来创建实际的应用程序.我在一部手机中遇到的问题之一是文字看起来太小了.还有一些图像也有点小.我添加了一个视口元标记,但它似乎也不起作用.以下是元标记:
I recently build an android app using html, css, javascript and running them through phonegap to create the actual app. One of the problems I encountered in one phone is that the text looks too small. Also some images are a little small as well. I added a viewport meta tag but it doesnt seem to work either. Here are the meta tags:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="format-detection" content="telephone=no" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densitydpi=device-dpi" />`
这是它的样子
This is how it looks
它应该是这样的:
This is how its supposed to look:
推荐答案
我遇到了同样的问题并解决了它改变视口的问题.我还以为是 phonegap 的问题,但实际上是用于测试的设备具有不同的 dpi.
I had the same problem and solved it changing the viewport. I also thought the problem was phonegap, but it really was that the devices used for testing had different dpi.
我的解决方案是将视口上的 target-densitydpi 更改为:
My solution was to change the target-densitydpi on the viewport to:
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, target-densitydpi=medium-dpi, user-scalable=0" />
希望能帮到你
这篇关于Phonegap 应用程序文本和布局太小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!