歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux編程 >> Linux編程 >> Android應用開發之國際化

Android應用開發之國際化

日期:2017/3/1 10:27:58   编辑:Linux編程

布局 main.xml

  1. <TextView
  2. Android:layout_width="fill_parent"
  3. android:layout_height="wrap_content"
  4. android:text="@string/hello" />
  5. <ImageButton
  6. android:layout_width="wrap_content"
  7. android:layout_height="wrap_content"
  8. 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" />
Copyright © Linux教程網 All Rights Reserved