首页 > 移动平台 > 详细

Android - 资源xml文件适配不同的版本

时间:2014-12-29 23:04:31      阅读:400      评论:0      收藏:0      [点我收藏+]

资源xml文件适配不同的版本


本文地址:http://blog.csdn.net/caroline_wendy


Adapt layout to Android platform or API level:把布局文件适配不同的API级别,避免警告;
通过为不同的API等级,建立不同的文件夹(layout-v4),进行适配,可以去掉Warning.

具体:
If what you‘re trying to do is show a different layout depending on which API version is available on the device, you want to use configuration qualifiers. The specifics for alternative resources are also documented.

The most basic way to do it is to create a layout folder for each API level you want to use, formatted as follows:

res/layout/mylayout.xml       (Default)
res/layout-v4/mylayout.xml    (Android 1.6)
res/layout-v11/mylayout.xml   (Android 3.0)
and so on, where vN is the API level. The specific API levels can be found on this page.


Android - 资源xml文件适配不同的版本

原文:http://blog.csdn.net/caroline_wendy/article/details/42245933

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!