<?xml version="1.0" encoding="utf-8"?>
<TabHost
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@android:id/tabhost"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="fill_parent"
android:layout_height="wrap_content" />
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:padding="5dp" />
</LinearLayout>
</TabHost>
错误异常:
Error during post inflation process:
TabHost requires a TabWidget with id "android:id/tabs".
View found with id 'tabs' is 'com.android.layoutlib.bridge.MockView'
The following classes could not be found:
- TabWidget (Change to android.widget.TabWidget, Fix Build Path, Edit XML)
如上所述快速修复指出:只要改变API的目标(XML的图形视图的左上角)到3.0,你可以看到它
如果有帮助到您,可以回复分享解决问题后的快乐感受~~