如何利用片段中的Andr​​oid 2.2? [英] how to use fragment in android 2.2?

查看:122
本文介绍了如何利用片段中的Andr​​oid 2.2?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有哪些支持Android 2.2 library.In这个程序,我想用碎片的应用程序 有人建议我,如果可能的话该怎么办呢。

I have an application which support android 2.2 library.In this app I want to use fragment someone suggest me ,if possible how to do it.

感谢

推荐答案

是的,你需要使用支持库。什么是要知道重要的是,您可以使用支持库在蜂窝和冰淇淋三明治也是如此。这样,你就可以使用相同的版本在所有平台上。 您需要使用SDK 4.0的目标与minsdk 2.2。 一个不同的问题是设置的活动。对于蜂窝+,你可以使用不支持的支持库却把preferenceFragment。 如果您使用的preferenceActivity在settings.xml新onBuildHeaders方法和头标签,你需要把该XML的文件夹分开例如像XML-V12来指定,它仅用于API-12 +

Yes you need to use the support library. What is important to know is that you can use the support library on honeycomb and icecream sandwich as well. In that way you can use the same build on all the platforms. You need to use the SDK 4.0 as target with minsdk 2.2. A different problem are the settings activities. For Honeycomb+ you can use the PreferenceFragment that are not supported by the support library yet. If you use the new onBuildHeaders method of PreferenceActivity and the "header" tag in the settings.xml you need to put that xml in a separated folder like for example xml-v12 to specify that it is used only with API-12+.

有关的设置,看看到: <一href="http://developer.android.com/reference/android/$p$pference/$p$pferenceActivity.html">http://developer.android.com/reference/android/$p$pference/$p$pferenceActivity.html 还有就是onBuildHeaders一个很好的例子

For the settings have a look to: http://developer.android.com/reference/android/preference/PreferenceActivity.html there is a good example of the onBuildHeaders

有关支持库: <一href="http://developer.android.com/sdk/compatibility-library.html">http://developer.android.com/sdk/compatibility-library.html

这篇关于如何利用片段中的Andr​​oid 2.2?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆