机器人TabHost德precated [英] Android TabHost deprecated

查看:163
本文介绍了机器人TabHost德precated的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我创建的应用程序,这将支持的Andr​​oid 2.2 到Android 4.1 。该 TabHost pcated在Android版本3.2代$ P $ 。但在所有的版本支持创建的应用程序。但我想创建标签栏应用程序,它看起来像在Android的一个标签栏 4.1 在运行应用程序的安卓4.2 ,如果我运行下面的应用程序的Andr​​oid 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.?

推荐答案

有很多点,你的问题,

  1. TabHost 德precated 的呢。最近谷歌德precated TabActivity 的ActivityGroup
  2. 即使德precated,它并不意味着它不能使用。 如果X是pcated德$ P $,它只意味着名为Y向更好的选择是存在的。
  1. TabHost is not deprecated yet. Recently Google deprecated TabActivity and ActivityGroup.
  2. 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

  1. 您可以使用ActionBarSherlock其他答案建议。
  2. 您可以使用 TabHost 与片段,见我的回答<一href="http://stackoverflow.com/questions/6987334/separate-back-stack-for-each-tab-in-android-using-fragments/12928498#12928498">here为一个 很好的例子。要使用片段在pre 3.0的API,你需要使用 谷歌的支持库。
  1. You can use ActionBarSherlock as other answers suggests.
  2. You can use TabHost with fragments, See my answer here for a good example. To use Fragment in pre 3.0 API's you need to use Google's support library.

这篇关于机器人TabHost德precated的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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