小编Dil*_*eep的帖子

片段选项卡主机错误:呈现期间引发异常:没有标记为null的选项卡

我已经使用片段标签主机一段时间了,它工作正常.突然间我得到了这个布局编译错误.

Exception raised during rendering: No tab known for tag null
Run Code Online (Sandbox Code Playgroud)

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>
Run Code Online (Sandbox Code Playgroud)

请不要将它关闭,因为我检查了所有线程,但我无法解决这个问题.

android android-fragments fragment-tab-host

6
推荐指数
1
解决办法
5137
查看次数