Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / Android应用开发之国际化

布局 main.xml
  1. <TextView  
  2.         Android:layout_width="fill_parent"  
  3.         android:layout_height="wrap_content"  
  4.         android:text="@string/hello" />  
  5.   
  6.     <ImageButton   
  7.         android:layout_width="wrap_content"  
  8.         android:layout_height="wrap_content"  
  9.         android:src="@drawable/exit"/>  

字符串国际化


values-zh
  1. <string name="hello">你好!</string>  
  2.    <string name="app_name">国际化</string>  
values-en
  1. <string name="hello">Hello World, I18nActivity!</string>  
  2.    <string name="app_name">I18n</string>  
values-en-rUS
  1. <string name="hello">Hello World, I18nActivity!,US</string>  
  2.     <string name="app_name">I18n</string>  

图片国际化

 屏幕适配


Layout-320x240
  1. <TextView  
  2.         android:layout_width="fill_parent"  
  3.         android:layout_height="wrap_content"  
  4.         android:text="320x240" />  
Layout-480x320
  1. <TextView  
  2.         android:layout_width="fill_parent"  
  3.         android:layout_height="wrap_content"  
  4.         android:text="480x320" />