6

フラグメント タブ ホストをしばらく使用してきましたが、問題なく動作していました。突然、このレイアウト コンパイル エラーが発生しました。

Exception raised during rendering: No tab known for tag null

activity_tabhost_search.xml:

<android.support.v4.app.FragmentTabHost 
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" >

<LinearLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TabWidget
        android:id="@android:id/tabs"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_weight="0"
        android:orientation="horizontal" />

     <FrameLayout
        android:id="@android:id/tabcontent"
        android:layout_width="match_parent"
        android:layout_height="0dp"
        android:layout_weight="1" />
</LinearLayout>

</android.support.v4.app.FragmentTabHost>

すべてのスレッドを確認しましたが、これを解決できませんでした。

4

2 に答える 2

0
 <TabWinget android:id="@+id/tabhost"

次のように変更する必要があります。

 <TabWidget android:id="@android:id/tabhost"
于 2014-06-19T11:27:51.923 に答える
0

LinearLayout私が思うに、あなたはで囲む必要がありますTabHost

多分これもあなたを助けるでしょ

他のトピックにリンクされている Vogella Tab チュートリアルはうまく機能し、現在アプリで使用しています。

于 2014-01-21T06:40:26.873 に答える