Android学习记录三(Supporting Different Devices)
来源:互联网 发布:2017程序员薪资报告 编辑:程序博客网 时间:2024/05/29 15:32
一、支持不同的语言。
Project
res/
values/ strings.xml
values-es/ strings.xml 支持Locale为es的
values-fr/ strings.xml 支持Locale为fr的
这种支持不同语言的方式可以用在任何的资源上。
二、支持不同的屏幕。
1、android一般通过2个属性来分辨系统的屏幕,大小和分辨率。一般类说有四种大小(small, normal, large, xlarge),
四种分辨率(low (ldpi), medium (mdpi), high (hdpi), extra high (xhdpi)),注意屏幕的方向也是大小的一种变化。
land表示android系统横屏时的布局。
2、对于图片来说主要是根据分辨率来获取相应的图片资源,分辨率分为四种:
small:75×75
normal: 100×100
large:150×150
xlarge:200×200
三、支持不同的android版本。
1、在AndroidManifest.xml 指定支持的最低版本和最高版本:
<uses-sdk android:minSdkVersion="4"android:targetSdkVersion="15"/>
2、在运行时验证当前android的版本:
if (Build.VERSION.SDK_INT>= Build.VERSION_CODES.HONEYCOMB){
ActionBar actionBar= getActionBar();
actionBar.setDisplayHomeAsUpEnabled(true);
}
在android解析xml文件时,会忽略那些当前版本不支持的xml元素。
3、指定主题(theme),样式(style):
style是应用于元素的,theme是应用于窗体的。如果要应用程序的所有窗体都使用一个theme,则可以
<applicationandroid:theme="@style/CustomTheme">
- Android学习记录三(Supporting Different Devices)
- android-Supporting Different Devices
- Supporting Different Devices笔记
- Supporting Different Devices - Supporting Different Screens
- Supporting Different Devices - Supporting Different Platform Versions
- Supporting Different devices - Supporting Different Languages
- Android Develop Training——Android应用支持多设备(Supporting Different Devices)
- lesson 2 Supporting Different Devices
- Android官方文档翻译 十二 3.Supporting Different Devices
- 阅读Android官方教程 Google Training 1.2 ------ Supporting Different Devices
- Android doc |Getting Started|部分 部分译文 --Supporting Different Devices
- (二)Supporting Different Devices支持不同的设备
- android training Supporting Different Screens
- Android 屏幕适配(Supporting Different Screen Sizes)
- android-Supporting Different Screens in Web Apps
- Android Training--Supporting Different Screen Sizes
- AndroidTraining学习------Support-Different-Devices
- 支持不同屏幕(Supporting Different Screens)
- 如何在IE8下调试activex控件
- linux下如何阻塞进程
- CKEditor 3.x 在Java中配置、包括图片上传、支持FTP、图片压缩
- sgu 224
- JVM Management API
- Android学习记录三(Supporting Different Devices)
- 如何生成serial version ID?
- python 按文件大小排序,含子目录文件
- Message 2100 not found; No message file for product=RDBMS, facility=ULMessage 2100 not found; No mes
- 练习2
- 用20%时间完成80%的管理工作
- Linux 的 I2C 体系结构
- memcached: error while loading shared libraries: libevent-2.0.so.5: cannot o
- 如何:配置和启动 MPI 群集调试程序