Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/200.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 根元素格式不正确:保存时添加了额外的标记_Android_Xml - Fatal编程技术网

Android 根元素格式不正确:保存时添加了额外的标记

Android 根元素格式不正确:保存时添加了额外的标记,android,xml,Android,Xml,我对这个完全陌生,我遵循这一页的指南 我复制他们的代码: <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" andro

我对这个完全陌生,我遵循这一页的指南

我复制他们的代码:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">
    <EditText android:id="@+id/edit_message"
        android:layout_weight="1"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:hint="@string/edit_message" />
    <Button
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/button_send" />
</LinearLayout>

但在保存时,它会在最底部自动创建一个新行:

<menu xmlns:android="http://schemas.android.com/apk/res/android"></menu>

它给了我一条关于这一行的错误信息。我在论坛上搜索,这条建议似乎让我失去了底线,但这是不可能的(!)。它在保存文件时自动返回

有人帮忙吗