根元素下列文件中的标记必须有良好的成形?下列、标记、元素、良好

由网友(残冬腊月.)分享简介:林收到这个错误在我activity_main.xml第9行由我也不知道为什么,请帮助。<的FrameLayout机器人:ID =@ + ID / main_content机器人:layout_width =match_parent机器人:layout_height =0dp机器人:layout_weight =1...

林收到这个错误在我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搜索这个错误,有很多职位相同的。 例如:

Android应用程序的根元素下列文件中的标记必须有良好的成形

The必须良好的标记根元素下在文档中。什么是这个原因?

Error :根元素下列文件中的标记必须有良好的成形请帮助我在新的Andr​​oid

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

更新

怎样把WORD文档中的字调得更大

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

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

< /的FrameLayout>
 

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>

阅读全文

相关推荐

最新文章