机器人TabHost德precated [英] Android TabHost deprecated
问题描述
我创建的应用程序,这将支持的Android 2.2
到Android 4.1
。该 TabHost
是 pcated在Android版本3.2代$ P $
。但在所有的版本支持创建的应用程序
。但我想创建标签栏
应用程序,它看起来像在Android的一个标签栏
4.1
在运行应用程序的安卓4.2
,如果我运行下面的应用程序的Android 3.2版本
设备,它必须看起来像该设备的标签栏
。我怎样才能做到这一点?
I am creating application which will support Android 2.2
to Android 4.1
. The TabHost
is deprecated in Android version 3.2
. But the created application supported in all the versions
. But I want to create the Tab bar
application which will look like a tab bar
in Android 4.1
while running the application in Android 4.2
, If I am running the application in below android 3.2 version
device, it must look like the tab bar
in that device. How can I do this.?
推荐答案
有很多点,你的问题,
-
TabHost
不德precated 的呢。最近谷歌德precatedTabActivity
和的ActivityGroup
。 - 即使德precated,它并不意味着它不能使用。 如果X是pcated德$ P $,它只意味着名为Y向更好的选择是存在的。
TabHost
is not deprecated yet. Recently Google deprecatedTabActivity
andActivityGroup
.- Even if it deprecated, it doesn't mean it can't be used. If X is deprecated, it only means a better alternative named Y is there.
现在回答你的问题,你有一个以上的选项
Now to answer your question, You have more than one options
- 您可以使用ActionBarSherlock其他答案建议。
- 您可以使用
TabHost
与片段,见我的回答<一href="http://stackoverflow.com/questions/6987334/separate-back-stack-for-each-tab-in-android-using-fragments/12928498#12928498">here为一个 很好的例子。要使用片段
在pre 3.0的API,你需要使用 谷歌的支持库。
- You can use ActionBarSherlock as other answers suggests.
- You can use
TabHost
with fragments, See my answer here for a good example. To useFragment
in pre 3.0 API's you need to use Google's support library.
这篇关于机器人TabHost德precated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!