Android的我怎么能代替pcated tabhost去$ P $? [英] Android how can i replace the deprecated tabhost?
问题描述
我要创建,其目的是使用 Tabhost
应用程序,但我知道它已经pcated德$ P $。所以我的问题是我应该用 Tabhost
反正要不我怎么能代替使用it..by按钮,而不是他们在每一个XML声明的或任何其他建议?
I'm going to create an application which is designed to use Tabhost
, but as I know it's been deprecated. So my question is should I use Tabhost
anyway or how can I replace it..by using buttons instead of them declared in every xml or any other suggestions?
推荐答案
在Android的pcated德$ P $的意思是我们认为这是一个更好的解决方案,你应该调查。很少有表示这是不可用pcated德$ P $。 <击> TabHost
,AFAIK,工作正常,在Android 4.0。
"Deprecated" in Android means "we think there is a better solution that you should investigate". Rarely does "deprecated" mean "it is unusable". TabHost
, AFAIK, works fine on Android 4.0.
话虽这么说,我会建议考虑改用标签操作栏中,使用 ActionBarSherlock 给你向后兼容Android 2.1系统。击>
That being said, I would recommend considering switching to tabs in the action bar, using ActionBarSherlock to give you backwards compatibility to Android 2.1.
更新
此外, TabHost
不是去precated。 TabActivity
是pcated德$ P $。您仍然可以使用 TabHost
,可欣赏你的标签。或者,使用:
Besides, TabHost
is not deprecated. TabActivity
is deprecated. You can still use TabHost
, with views for your tabs. Or, use:
-
ViewPager
带标签的指标,如PagerTabStrip
-
FragmentTabHost
,如果TabHost
使用片段的标签
ViewPager
with a tabbed indicator, likePagerTabStrip
FragmentTabHost
, for aTabHost
that uses fragments for tabs
操作栏也有选项卡的支持,但是这是德precated开始的L开发preVIEW。
The action bar also has tab support, but that was deprecated starting with the "L" Developer Preview.
这篇关于Android的我怎么能代替pcated tabhost去$ P $?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!