gpt4 book ai didi

android - Galaxy S4 从 MDPI 中获取值?

转载 作者:行者123 更新时间:2023-11-30 02:56:41 24 4
gpt4 key购买 nike

我想为每个密度使用单独的 values,所以我为每个密度创建了不同的 values 文件夹,

values
values-ldpi
values-mdpi
values-hdpi
values-xhdpi
values-xxhdpi

在每个 strings.xml 文件中,我写了密度(对于 values-xxhdpi,我有一个字符串,文本为“xxhdpi "), 但是当我在 GS4 上运行它时,我得到了 "mdpi"字符串,

我也确实创建了单独的 layout 文件夹,但始终采用 layout-mdpi 密度

任何可能发生的事情的线索?

最佳答案

根据密度而不是大小来定义布局对我来说有点可笑。 Drawable 和其他类似资源取决于密度,但布局取决于大小。

请看这里:http://developer.android.com/guide/practices/screens_support.html

对于值,您可以尝试使用 values-normal、values-large 等。

我写这篇文章虽然你所做的应该根据这个线程工作:https://stackoverflow.com/a/9639280/693752

另外,您对这个资源很感兴趣: http://developer.android.com/guide/topics/resources/providing-resources.html#BestMatch

----更新----

看这个来自 GodFather 的回答: https://stackoverflow.com/a/20521720/693752

(Note that density qualifiers are even fuzzier -- -mdpi will be used for any device density, in the absence of a better match, as density qualifiers are designed to be used only on drawable directories, where Android can apply resampling algorithms. Using density qualifiers on anything other than drawables and maybe dimension resources is a code smell.)

关于android - Galaxy S4 从 MDPI 中获取值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23155901/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com