码迷,mamicode.com
首页 > 移动开发 > 详细

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

时间:2014-12-29 23:06:20      阅读:337      评论:0      收藏:0      [点我收藏+]

标签:mystra   android   api level   layout   warning   

资源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文件适配不同的版本

标签:mystra   android   api level   layout   warning   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!