Android
来源:互联网 发布:淘宝上的上海大药房 编辑:程序博客网 时间:2024/05/01 21:40
1.尽量使用线性布局(LinearLayout)和相对布局(RelativeLayout),不要使用绝对布局。
2.尽量使用dip和sp,不要使用px。
3.为不同的分辨率提供不同的布局文件和图片。
例如:
4.在AndroidMainfest.xml中设置多分辨率支持。
1 <supports-screens 2 android:largeScreens="true"3 android:normalScreens="true" 4 android:anyDensity="true"5 android:smallScreens="true" />
总结一下:
1)android:anyDensity="true",系统会依据屏幕密度,自动去找对应的文件夹。
2)android:anyDensity="false"
(1) 如果drawable-hdpi,drawable-mdpi,drawable-ldpi三个文件夹中有同一张图片资源的不同密度表示,那么系统会去加载drawable_mdpi文件夹中的资源
(2) 如果drawable-hpdi中有高密度图片,其它两个文件夹中没有对应图片资源,那么系统会去加载drawable-hdpi中的资源。
(3) 如果drawable-hdpi,drawable-mdpi中有图片资源,drawable-ldpi中没有对应的图片资源,那么系统会加载drawable-mdpi文件夹中的资源
参考博客:http://blog.sina.com.cn/s/blog_74c22b210100tn3o.html
<script type="text/javascript"><!--google_ad_client = "ca-pub-1944176156128447";/* cnblogs 首页横幅 */google_ad_slot = "5419468456";google_ad_width = 728;google_ad_height = 90;//--></script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
- Android
- android
- Android
- android
- android
- Android
- Android
- android
- android
- android
- Android
- Android
- android!!!
- android
- android
- android
- android
- android:
- design pattern概述和Singleton模式
- tomcat7与tomcat6引入标签taglib的区别:taglib definition not consistent with specification version
- javax.crypto.IllegalBlockSizeException: last block incomplete in decryption
- zk event thread model
- linux find命令详解
- Android
- 使用Vitamio打造自己的Android万能播放器(12)—— 播放网络视频缓冲处理
- soj4236 && soj2750
- 黑马程序员--面向对象(一)
- Linux切换键命令及常用指令
- Android设备的识别
- android SDK 安装目录结构详解及各工具
- 关于二叉查找树的一些题目
- ffmpeg 应用(1)