为什么Android使用资源从更高的资源,而不是低? [英] Why Android uses resources from the higher resource instead of a lower?

查看:111
本文介绍了为什么Android使用资源从更高的资源,而不是低?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有是我想领养到xhdpi分辨率手机的应用程序。所以我做的资源该决议以及所有关于xhdpi手机了罚款。

There is an app which I want to adopt to xhdpi resolution phones. So I made resources for that resolution and all went fine regarding the xhdpi phones.

我有一个测试手机是正常华电国际和布局,现在搞砸了(在我的手机xhdpi作出修正。

I have a test mobile phone which is normal hdpi and the layout is now messed up (after I made fixes for xhdpi phones.

布局结构如下:

/ RES /绘,HDPI结果
/ RES /绘正常,xhdpi结果
/ RES /布局结果
/ RES /布局正常xhdpi

当我上加载正常华电国际手机的应用程序,我看到它使用的布局从 / RES /布局正常xhdpi 及图片来自 / RES /绘正常-xhdpi

When I load the app on normal hdpi phone, I see that it uses layout from /res/layout-normal-xhdpi and images from /res/drawable-normal-xhdpi.

难道不应该使用的资源从低资源文件夹如 / RES /布局 / RES /绘,华电国际?这不,我不知道为什么。

Shouldn't it use resources from the lower resource folder like /res/layout and /res/drawable-hdpi? It does not and I do not know why.

推荐答案

据<一个href=\"http://developer.android.com/intl/zh-CN/guide/topics/resources/providing-resources.html#BestMatch\"相对=nofollow> Android如何寻找相矛盾的设备配置最匹配的资源系统消除了资源文件,但看起来,因为此异常像你的情况预计,

According to How Android Finds the Best-matching Resource system eliminates resource files that contradict the device configuration, but it looks like your case is expected, because of this exception:

例外:屏幕像素密度是一个定性未因矛盾消除

Exception: Screen pixel density is the one qualifier that is not eliminated due to a contradiction.

本办法正常华电国际的设备配置相匹配,以 / RES /绘正常-xhdpi

This way a device of normal hdpi configuration matches to /res/drawable-normal-xhdpi.

这篇关于为什么Android使用资源从更高的资源,而不是低?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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