Android 资源国际化问题(2): finger的迷惑
来源:互联网 发布:知乎 非最大抑制 编辑:程序博客网 时间:2024/06/04 19:54
在上篇博客http://blog.csdn.net/androidbluetooth/article/details/6651915中大致说说开源项目如何做到国际化的,关于出现finger的文件夹,让我有点迷惑。
特意做个小测试,共享一下。
任意建一个android项目。看一下res目录结构:
drawable-hdpi-finger与drawable-ldpi目录下面两张图片名称一样,但是图片不是同一张,分别是:
、
layout、layout-finger、layout-land-finger下面的main.xml文件内容分别是:
layout/main.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><ImageViewandroid:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon" /> <Buttonandroid:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/icon" /> <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="layout only"/> </LinearLayout>layout-finger/main.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><ImageViewandroid:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon" /> <Buttonandroid:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/icon" /> <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="layout-finger"/> </LinearLayout>
layout-land-finger/main.xml
<?xml version="1.0" encoding="utf-8"?><LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="fill_parent" ><ImageViewandroid:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/icon" /> <Buttonandroid:layout_width="wrap_content" android:layout_height="wrap_content" android:background="@drawable/icon" /> <TextView android:layout_width="fill_parent" android:layout_height="fill_parent" android:text="layout-land-finger"/> </LinearLayout>可以看出,他们区别在于TextView的显示内容不同,其它的一样。
运行App,在模拟器上显示效果
切换模拟器屏幕方向:
可以看出,显示的图片始终是,而不是。说明带有finger的文件夹优先级别较高。
有这种解释:
layout-land-finger:适合电容屏、电阻屏以及非触摸屏的设备并且该设备是水平方向。
layout-finger:适合电容屏、电阻屏以及非触摸屏的设备但不要求是水平方向。
layout:适合电阻屏以及非触摸屏的设备。
我在自己的android手机上面测试,效果是一样的。
- Android 资源国际化问题(2): finger的迷惑
- Android 资源国际化问题(1): 来自开源的启示
- Android 资源国际化问题(3): 不同像素的手机
- Android代码资源的国际化
- Android代码资源的国际化
- Android代码资源的国际化
- Android代码资源的国际化
- Android代码资源的国际化
- Android代码资源的国际化
- Android代码资源的国际化
- Android代码资源的国际化a
- Android的资源自适应与国际化
- 关于Android国际化的使用资源指定
- Android 资源和国际化
- Android 资源和国际化
- Android 资源和国际化
- Android 资源和国际化
- Android 资源和国际化
- android 查看系统数据库——以短信为例
- 计算机达人成长之路
- C++面试题
- FLASHxml
- 有趣的C语言问题 测试你对C语言的熟悉程度
- Android 资源国际化问题(2): finger的迷惑
- ListView和DataGridView性能比较
- C++的引用类型
- 今天是个好日子
- 如何取出Map中的key和value--Map.Entry 类使用简介
- SED单行脚本快速参考
- SystemParametersInfo 完整详细用法(转自Microsoft MSDN) 英文版,请自行翻译
- 关于windows系统的不满意,很慢,性能不好
- POJ1904/ZOJ2470 King's Quest(tarjan判强连通分量)