Dil*_*eep 6 android android-fragments fragment-tab-host
我已经使用片段标签主机一段时间了,它工作正常.突然间我得到了这个布局编译错误.
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)
请不要将它关闭,因为我检查了所有线程,但我无法解决这个问题.
我认为你必须LinearLayout用TabHost
也许这对您也有帮助How do I use tabHost for Android
其他主题中链接的 Vogella Tab 教程效果很好,目前我正在我的应用程序中使用它。
| 归档时间: |
|
| 查看次数: |
5137 次 |
| 最近记录: |