Over riding eclipse with TabHost error
I currently have this error that I believe to be a fault in eclipse:
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
This is apparently a problem with this code:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<LinearLayout android:id="@+id/linearLayout1"
android:layout_width="fill_parent" android:layout_height="wrap_content"
android:orientation="vertical" android:background="@drawable/bkgrnd">
<RelativeLayout android:layout_height="wrap_content"
android:id="@+id/relativeLayout1" android:layout_width="wrap_content">
<ImageView android:layout_width="wrap_content" android:src="@drawable/quizicon"
android:layout_height="wrap_content" android:id="@+id/imageView1"
android:layout_alignParentLeft="true" android:layout_alignParentTop="true"></ImageView>
<TextView android:id="@+id/textView1" android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_alignParentTop="true" android:textSize="@dimen/menuTitleSize"
android:text="@string/scores"></TextView>
<ImageView android:layout_width="wrap_content" android:src="@drawable/quizicon"
android:layout_height="wrap_content" android:id="@+id/imageView2"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"></ImageView>
</RelativeLayout>
<TabHost android:id="@android:id/tabhost"
android:layout_width="fill_parent" android:layout_height="fill_parent">
<LinearLayout android:id="@+id/linearLayout2"
android:layout_width="fill_parent" android:layout_height="fill_parent"
android:orientation="vertical">
<TabWidget android:layout_width="fill_parent"
android:layout_height="wrap_content" android:id="@android:id/tabs"></TabWidget>
<FrameLayout android:layout_width="fill_parent"
android:layout_height="fill_parent" android:id="@android:id/tabcontent">
<TableLayout android:id="@+id/TableLayout_AllScores"
android:layout_height="fill_parent" android:layout_width="fill_p开发者_如何学Goarent"
android:stretch_columns="*"></TableLayout>
<TableLayout android:id="@+id/TableLayout_FriendScores"
android:layout_height="fill_parent" android:layout_width="fill_parent"
android:stretch_columns="*"></TableLayout>
</FrameLayout>
</LinearLayout>
</TabHost>
</LinearLayout>
</LinearLayout>
Since this is an error with eclipse, and the code is actually correct, is there a way to override the error so it'll let me compile.
This isnt a great answer but eclipse at times has listed non-existent errors for me, after exhaustive debugging if I cant find the answer I have resolved by deleting the error from the error list and cleaning the project, then build the project.
Ronan
精彩评论