【发布时间】:2015-12-26 14:25:25
【问题描述】:
我使用了下面的代码,它不是渲染图形布局。将错误显示为Exception raised during rendering: No tab known for tag null。
我该如何解决这个问题?
<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="0dp"
android:layout_height="0dp"
android:layout_weight="0" />
<FrameLayout
android:id="@+id/realtabcontent"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1" />
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
【问题讨论】:
-
你用的是什么代码?你在使用菜单xml吗?你有 logcat 吗?
-
你能把初始化 TabHost 的代码贴出来吗?
-
我打开了一个错误报告,请投票:code.google.com/p/android/issues/detail?id=78772