Android的华电国际/ MDPI / LDPI的价值观文件夹? [英] Android hdpi/mdpi/ldpi for Values folder?

查看:136
本文介绍了Android的华电国际/ MDPI / LDPI的价值观文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android的允许我们定义华电国际/ MDPI / LDPI的绘制文件夹,以便考虑不同的屏幕尺寸/设备。我在想,如果同样的支持,可以适用的价值观文件夹(甚至是布局文件夹)?原因是,我通常会定义一个sizes.xml文件,该文件认为我申请利润率和补白标准DP的大小。我也做了相同的SP大小的文本。我想基于手机DPI调节这些值。

Android allows us to define hdpi/mdpi/ldpi for the drawable folder in order to account for different sized screens/devices. I was wondering if that same support can be applied for the Values folder (or even the layout folder)? Reason being, I typically define a "sizes.xml" file which holds standard dp sizes that I apply to margins and paddings. I also do the same for sp sizes for text. I'd like to adjust those values based on the phones dpi.

推荐答案

是的,我相信 RES / 文件夹中任何事情都有可能使用配置预选赛。因此,例如,你可以有一个价值观sw600dp-MDPI陆/ 文件夹。

Yes, I believe anything in the res/ folder can use "Configuration Qualifiers". So for example, you can have a values-sw600dp-mdpi-land/ folder.

请参阅使用配置限定符: <一href="http://developer.android.com/guide/practices/screens_support.html#qualifiers">http://developer.android.com/guide/practices/screens_support.html#qualifiers

See "Using Configuration Qualifiers": http://developer.android.com/guide/practices/screens_support.html#qualifiers

我第一次注意到这个通过查看谷歌的IOSched应​​用程序示例code,看看 RES 文件夹: <一href="https://github.com/google/iosched/tree/master/android/src/main/res">https://github.com/google/iosched/tree/master/android/src/main/res

I first noticed this by looking at Google's IOSched app sample code, look at the res folder: https://github.com/google/iosched/tree/master/android/src/main/res

您会看到,他们有价值观sw600dp陆,价值观w400dp和价值观V17文件夹,只是仅举几例。

You'll see that they have "values-sw600dp-land", "values-w400dp" and "values-v17" folders, just to name a few.

这篇关于Android的华电国际/ MDPI / LDPI的价值观文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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