2011-07-23 4 views
0

と乗馬日食が経つにつれて私は現在、私は日食の障害であると信じるこのエラーを持っている:は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 

これは明らかに、このコードの問題である:

<?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_parent" 
         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> 

これがあるので、 Eclipseとのエラー、そしてコードは実際には正しいです、エラーを上書きする方法がありますので、コンパイルさせてください。

答えて

0

これは素晴らしい答えではありませんが、エラーリストからエラーを削除して解決した解決策が見つからない場合は、徹底的なデバッグを行った後、プロジェクト。

ロナン