想用Tab
拉了个TabHost放在xml布局文件上。提示:
rror 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)
xml的graphic layer也看到效果了,xml文件中@android:id/tabhost  android:id/tabs @android:id/tabcontent都有啊这个错误是什么意思,我该怎么解决呢?

解决方案 »

  1.   

    @android:id/tabhost android:id/tabs @android:id/tabcontent
     注意中间个没有“@”
    另外你不把代码贴出来 很难猜滴
      

  2.   

    多谢楼上的回复,中间@有的,weather.xml文件就是
    <?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"
      android:id="@+id/weatherset">
        <TabHost android:id="@android:id/tabhost" android:layout_width="fill_parent" android:layout_height="fill_parent">
            <LinearLayout android:layout_width="fill_parent" android:id="@+id/linearLayout1" 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">
                    <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/tab1"></LinearLayout>
                    <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/tab2"></LinearLayout>
                    <LinearLayout android:layout_width="fill_parent" android:layout_height="fill_parent" android:id="@+id/tab3"></LinearLayout>
                </FrameLayout>
            </LinearLayout>
        </TabHost>
    </LinearLayout>graphical layer视图提示如下错误:
    rror 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)
      

  3.   

    我就是拉了一个TabHost放xml上,其他什么都还没动。
      

  4.   

    我看了下 你这个程序没有错  可能是sdk的bug吧  你运行是不会报错的。我的也是这样,照样用。
      

  5.   

    重新编译几次,不然就把eclipse重启几次,有时候就好了。。
    我上次也这个,是不是就这样,然后就重启,就又好了。
      

  6.   

    不行啊,运行不了
    在onCreate里面都出错
    super.onCreate(savedInstanceState);
    setContentView(R.layout.weatherset);提示遇到错误。
      

  7.   

    出来一个Class File Editor说:Source not foundThe JAR ........\android.jar has no source attachment
    You can attach the source by clikcing Attach Source Below......这是什么意思啊。我运行其他的android程序都好好的,唯独有tabhost的时候就出这样的错误。