2012-06-12 50 views
2

我试着做一个项目使用标签活动。但问题是当我声明标签活动其不工作。当TabActivity处于弃用状态时应该怎么做?

我认为我的填充不正确,所以我修复了xml.But它仍然是相同的。这是我的选项卡的XML。

<?xml version="1.0" encoding="utf-8"?> 
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@android:id/tabhost" 
android:layout_width="fill_parent" 
android:layout_height="fill_parent"> 
<LinearLayout 
    android:orientation="vertical" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent"> 
    <TabWidget 
     android:id="@android:id/tabs" 
     android:layout_width="fill_parent" 
     android:layout_height="wrap_content" /> 
    <FrameLayout 
     android:id="@android:id/tabcontent" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"/> 
</LinearLayout> 
</TabHost> 

我该如何解决这个问题?

回答

4

在软件开发的世界里,“不推荐”是指正在被新的代码所替代的函数或元素,所以代替TabActivity你可以去FragmentTabs

相关问题