2012-06-12 55 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

相關問題