在手机和平板电脑上设置字体大小 [英] Set font size on phone and tablet
问题描述
如何设置手机和平板电脑上textview的字体大小。我提到的帖子建议创建 dimen.xml
并将它们放在不同的文件夹中,即 values-mdpi
, values-hdpi
, values-ldpi
。平板电脑(1024x600)的分辨率会从 values-mdpi
文件夹中选取,手机(320x480)也会从 values-mdpi
文件夹,这使得字体看起来真的很大,在手机上扭曲,而在平板电脑上看起来很好。
有什么方法可以指定字体大小分别为手机和平板电脑。
对于我使用的平板电脑:
-
values-sw600dp
for 7 -
values-sw720dp
for 10
这个解析不仅可以用于定位尺寸,还可以用于其他值,样式)。
How to set the font size for a textview in a phone and a tablet. The posts I've referred suggested to creating dimen.xml
and placing them in different folders namely values-mdpi
,values-hdpi
,values-ldpi
. The tablet (1024x600) resolution picks from the values-mdpi
folder and so does the the phone (320x480) also picks from the values-mdpi
folder, this makes the font look really big and distorted on the phone, whereas it looks fine on the tablet.
Is there any way to specify a font size for the phone and tablet separately.
For tablets I use:
values-sw600dp
for 7″values-sw720dp
for 10″
This slution can be used not just for localizing dimensions but also other values (for instance, styles).
这篇关于在手机和平板电脑上设置字体大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!