不同的字体大小不同的屏幕大小 [英] Different font sizes for different screen sizes

查看:141
本文介绍了不同的字体大小不同的屏幕大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序必须使用一个较小的字体为中密度设备。是否可以指定?

In my application I must use a smaller font for the medium density devices. Is it possible to specify that?

推荐答案

您应该使用风格,那么你可以有单独的文件夹值(默认)值 - 华电国际(高密度)的价值观,MDPI(中密度)等,并根据需要把你的样式文件与正确的TEXTSIZE值的每个文件夹中。

You should use styles, then you can have separate folders "values" (default) "values-hdpi" (high density) "values-mdpi" (medium density) and so on and put your style file with correct textSize values in each folder as needed.

然后,当你在中密度装置将是否存在或值中,如果不挑的价值观,MDPI文件夹中的文件,且同为高密度等...

Then, when you are in medium density device it will pick the file in "values-mdpi" folder if exists or in "values" if not, and the same for high density etc...

这个原则同样适用于人的资源的子文件夹(可绘制值,等...)

This same principle applies to al "res" subfolders (drawables, values, etc...)

这篇关于不同的字体大小不同的屏幕大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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