android.support.v4.app.FragmentTabHost以XML格式呈现
我遇到了渲染问题: 呈现期间引发异常:必须调用接受上下文和FragmentManager的setup()android.support.v4.app.FragmentTabHost以XML格式呈现,android,xml,fragment-tab-host,Android,Xml,Fragment Tab Host,我遇到了渲染问题: 呈现期间引发异常:必须调用接受上下文和FragmentManager的setup() 但是如果我从android.support.v4.app.FragmentTabHost改为TabHost,就可以了。我做错了什么?可能重复“是”,但没有答案。很可能是FragmentTabHost中的一个bug。 <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http:/
但是如果我从
android.support.v4.app.FragmentTabHost
改为TabHost
,就可以了。我做错了什么?可能重复“是”,但没有答案。很可能是FragmentTabHost
中的一个bug。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.v4.app.FragmentTabHost
android:id="@android:id/tabhost"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<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" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>
</android.support.v4.app.FragmentTabHost>
</RelativeLayout>