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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值