根元素下列文件中的标记必须有良好的成形? [英] The markup in the document following the root element must be well-formed?

查看:133
本文介绍了根元素下列文件中的标记必须有良好的成形?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

林收到这个错误在我activity_main.xml第9行由我也不知道为什么,请帮助。          

 <的FrameLayout
    机器人:ID =@ + ID / main_content
    机器人:layout_width =match_parent
    机器人:layout_height =0dp
    机器人:layout_weight =1>

<的WebView
    机器人:ID =@ + ID / web视图
    机器人:layout_width =FILL_PARENT
    机器人:layout_height =FILL_PARENT/>
< /的FrameLayout>
 

解决方案

如果你用Google搜索这个错误,有很多职位相同的。 例如:

<一个href="http://stackoverflow.com/questions/7090577/android-app-the-markup-in-the-document-following-the-root-element-must-be-well">Android应用程序的根元素下列文件中的标记必须有良好的成形

<一个href="http://stackoverflow.com/questions/16637251/the-markup-in-the-document-following-the-root-element-must-be-well-formed-what">The必须良好的标记根元素下在文档中。什么是这个原因?

<一个href="http://stackoverflow.com/questions/16620042/error-the-markup-in-the-document-following-the-root-element-must-be-well-forme">Error :根元素下列文件中的标记必须有良好的成形请帮助我在新的Andr​​oid

等。 基本上,它说,你只能有一个根整个XML 文件中的元素。 sniplet你已经证明不看完整的XML。只要确保你只需要为他们的XML文件,剩下的一个根元素是根元素的子。希望这可以帮助。如果没有,那么请不要发布完整的XML文件,我们可以帮助人们更好地。

更新

在上面显示你有两个的FrameLayout 根元素code。这里应该只有一个。因此,(根据您的需求)更改为类似如下,以便只有一个根元素有:

 &LT; XML版本=1.0编码=UTF-8&GT?;
&LT;的FrameLayout的xmlns:机器人=htt​​p://schemas.android.com/apk/res/android
    机器人:ID =@ + ID / fullscreen_custom_content
    机器人:layout_width =match_parent
    机器人:layout_height =match_parent
    机器人:后台=#FF000000&GT;
    &LT;的FrameLayout
        机器人:ID =@ + ID / main_content
        机器人:layout_width =match_parent
        机器人:layout_height =match_parent/&GT;
    &LT;的WebView
        机器人:ID =@ + ID / web视图
        机器人:layout_width =FILL_PARENT
        机器人:layout_height =FILL_PARENT/&GT;

&LT; /的FrameLayout&GT;
 

Im getting this error in my activity_main.xml on line 9 by I have no idea why please help.

<FrameLayout
    android:id="@+id/main_content"
    android:layout_width="match_parent"
    android:layout_height="0dp"
    android:layout_weight="1" >

<WebView
    android:id="@+id/webView"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent" />
</FrameLayout>

解决方案

If you would have googled this error, there are lots of post for the same. Eg:

Android app, The markup in the document following the root element must be well-formed

The markup in the document following the root element must be well-formed. What is the cause of this?

Error : The markup in the document following the root element must be well-formed Please help I am new at android

and so on. Basically it says that you can only have one root element for the whole XML file. The xml sniplet you've shown does not look complete. Just make sure that you only have one root element for the XML file and rest of them are child of that root element. Hope this helps. If it doesn't then please do post the complete XML file for us to help better.

Update

In the code shown above you have two FrameLayout root elements. There should be only one. So change it(based on your needs) to something like below, so that only one root element is there:

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/fullscreen_custom_content"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="#FF000000">
    <FrameLayout
        android:id="@+id/main_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"/>
    <WebView
        android:id="@+id/webView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent" />

</FrameLayout>

这篇关于根元素下列文件中的标记必须有良好的成形?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆