android怎么在不同环境设置下选择不同的resource呢

android怎么在不同环境设置下选择不同的resource呢,例如,不同的语言设置,屏幕不同的方向,屏幕不同大小之类。

一般请况下我们会在那些resource folder 后面加上qualifiers,如果加两个或以上qualifiers,我们要按以下的顺序加

Table 15.1 Characteristics with configuration qualifiers

  1. Mobilecountrycode(MCC),optionallyfollowedbymobilenetworkcode(MNC)

  2. Language code, optionally followed by region code

  3. Layout direction

  4. Smallest width

  5. Availablewidth

  6. Availableheight

  7. Screensize

  8. Screenaspect

  9. Screenorientation

  10. UI mode

  11. Night mode

  12. Screen density (dpi)

  13. Touchscreen type

  14. Keyboard availability

  15. Primary text input

  16. Navigation key availability

  17. Primary non-text navigation method

  18. API level

You can find descriptions of these characteristics and examples of specific configuration qualifiers at http://developer.android.com/guide/topics/resources/providing-resources.html#AlternativeResources. 

同样,android 系统在除掉了不合符的resource 后,就按上图的顺序的qualifier 去找到最合适的resource 来用了

You can see a complete list of supported (unqualified) res subdirectories at http://developer.android.com/guide/topics/resources/providing-resources.html#ResourceTypes. 

from bigNerRanchGuide

原文地址:https://www.cnblogs.com/howarddeng/p/5439895.html