2012-07-26 55 views
0

我有以下XML代码:XML错误 - 标记的根元素

<?xml version="1.0" encoding="utf-8"?> 
<TabHost xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="fill_parent" 
    android:layout_height="fill_parent" 
    android:id="@android:id/tabhost" > 

    <LinearLayout android:orientation="vertical" 
     android:layout_width="fill_parent" 
     android:layout_height="fill_parent"> 
     <TabWidget android:id="@android:id/tabs" 
      android:layout_width="fill_parent" 
      android:layout_height="wrap_content"> 
     </TabWidget> 
     <FrameLayout android:id="@android:id/tabcontent" 
       android:layout_width="fill_parent" 
       android:layout_height="fill_parent"> 

     </FrameLayout> 

    </LinearLayout> 

</TabHost> 

错误信息:“在documentfollowing很好的根元素的标记 - 执行 所有标签都关闭,有什么事情原因?

+0

尝试按Ctrl + Shift + F到您的XML代码,将格式化Ť他编码并再试一次。 – AkashG 2012-07-26 08:24:08

+0

清理你的项目。 – 2012-07-26 08:26:52

+0

工作!!! TNX! – Inbali 2012-07-26 08:26:58

回答

0

尝试ctrl + shift + F你的XML代码,将设置代码的格式和清洁project.it将工作后再试。