本文介绍了Phonegap / Cordova应用收缩太小的高分辨率设备,如三星Galaxy S4的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在iPhone 4 / 4S(640x960),HTC Desire HD(480x800),三星Galaxy Note等设备上,使用下面的设置,我的PhoneGap / Cordova应用看起来不错。

My Phonegap/Cordova app looks fine with the setting below, on devices like iPhone 4/4S (640x960), HTC Desire HD (480x800), Samsung Galaxy Note etc.

<meta name="viewport" content="user-scalable=no, initial-scale=0.75, maximum-scale=1, minimum-scale=0.75, width=device-width, height=device-height, target-densitydpi=device-dpi" />

但是它在超高分辨率设备上收缩太小,例如Samsung Galaxy S4(1080x1920,5.0英寸〜441 ppi像素密度),用户可能需要放大镜来阅读它。

But it shrinks too small on ultra high resolution devices like Samsung Galaxy S4 (1080x1920, 5.0 inches ~441 ppi pixel density), that user may need a magnifying glass to read it.

如何调整视口,使其在所有手机/平板电脑上看起来大小相同无论屏幕尺寸或像素密度如何?

How do I tweak the viewport so that it looks about the same size across all phone/tablet regardless of screen size or pixel density?

我尝试将比例增加到1.5,但在S4上可读,但是在低密度设备上的一切都太大。

I tried increase the scale to 1.5, it's readable on S4 but then everything is too large on lower density devices.

任何想法?

推荐答案

尝试替换 device-dpi medium-dpi device-dpi 可防止默认缩放,而 medium-dpi 会在低密度屏幕上缩小,屏幕。

Try replacing device-dpi by medium-dpi. device-dpi prevents default scaling, while medium-dpi will scale down on low density screens and scale up on high density screens.

这里有一些参考资料

原始帖子和答案在这里:

Original post and answer go here: http://stackoverflow.com/a/15545381/1039194

这篇关于Phonegap / Cordova应用收缩太小的高分辨率设备,如三星Galaxy S4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-03 17:10