什么是正确的方法来设置我绘制的目录,以支持新的Dell Streak,而不会失去对旧设备的支持? [英] What is the proper way to set my drawable directories to support the new Dell Streak without losing support for older devices?

查看:97
本文介绍了什么是正确的方法来设置我绘制的目录,以支持新的Dell Streak,而不会失去对旧设备的支持?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这似乎是一个 wides $ P $垫问题

我有以下绘制目录:

drwxr-xr-x  18 mike  staff   612 Feb  4 17:28 drawable/
drwxr-xr-x  51 mike  staff  1734 Feb  4 17:32 drawable-nodpi/
drwxr-xr-x  44 mike  staff  1496 Feb  4 17:30 drawable-normal-mdpi/

我的XML绘制资源的绘制。我的资源用于大MDPI(戴尔Streak)和正常华电国际(的Droid,Nexus的,不可思议的,等等)都在绘制-nodpi。我的资源正常MDPI(如G1旧的手机)在绘制正常-MDPI。

My xml drawable resources are in drawable. My resources intended for the large-mdpi (Dell Streak) and normal-hdpi (Droid, Nexus, Incredible, etc.) are all in drawable-nodpi. My resources for normal-mdpi (older phones like the G1) are in drawable-normal-mdpi.

不幸的是,正常华电国际手机一样的Droid从绘制正常,MDPI,而不是从绘制,nodpi拉着他们的资源。这是因为href="http://developer.android.com/intl/fr/guide/topics/resources/providing-resources.html" rel="nofollow">如何安卓找到最佳的

Unfortunately, the normal-hdpi phones like the Droid are pulling their resources from drawable-normal-mdpi instead of from drawable-nodpi. This is likely because of the rules in How Android Finds the Best-matching Resource.

所以,问题是,我该如何为像与正常华电国际设备,如对Droid,雷克大MDPI设备的支持,以及像G1的正常MDPI设备?

So the question is, how do I provide support for large-mdpi devices like the Streak along with normal-hdpi devices like the Droid, as well as normal-mdpi devices like the G1?

最简单的解决方案可能会作出我的大资源,一个在正常华电国际的机器人,一个在大MDPI的连胜两个副本,但我想,以避免重复所有这些资源。

The simplest solution would probably be to make two copies of my large resources, one in normal-hdpi for the droid and one in large-mdpi for the streak, but i'd like to avoid duplicating all of these resources.

更新

每梅拉的建议下,我可以做一个别名为每种资源。但是,也有很多资源,我不得不做出的别名,这将使维护噩梦前进,所以我希望另一种解决方案。

Per Mayra's suggestion, I could make an alias for every resource. However, there are a lot of resources I'd have to make aliases for, which would make maintenance a nightmare going forward, so I'm hoping for another solution.

推荐答案

<打击>重命名绘制-nodpi到绘制-nodpi-800×480(即nodpi需要在那里,或者它不会工作!)和重命名绘制正常,MDPI到可绘 - 小480x320。

Rename your "drawable-nodpi" to "drawable-nodpi-800x480" (the nodpi needs to be in there, or it wont work!) and rename "drawable-normal-mdpi" to "drawable-480x320".

这篇关于什么是正确的方法来设置我绘制的目录,以支持新的Dell Streak,而不会失去对旧设备的支持?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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