Android应用开发之国际化

来源:互联网 发布:迈阿密热线 知乎 编辑:程序博客网 时间:2024/05/22 01:36

布局 main.xml

<TextView        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="@string/hello" />    <ImageButton         android:layout_width="wrap_content"        android:layout_height="wrap_content"        android:src="@drawable/exit"/>

字符串国际化


values-zh

 <string name="hello">你好!</string>    <string name="app_name">国际化</string>

values-en

 <string name="hello">Hello World, I18nActivity!</string>    <string name="app_name">I18n</string>

values-en-rUS

<string name="hello">Hello World, I18nActivity!,US</string>    <string name="app_name">I18n</string>

图片国际化

 屏幕适配


Layout-320x240

<TextView        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="320x240" />

Layout-480x320

<TextView        android:layout_width="fill_parent"        android:layout_height="wrap_content"        android:text="480x320" />


原创粉丝点击