Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/13.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/elixir/2.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_Android Layout - Fatal编程技术网

Android 文档中根元素后面的标记必须格式正确。我不知道

Android 文档中根元素后面的标记必须格式正确。我不知道,android,xml,android-layout,Android,Xml,Android Layout,我不熟悉安卓系统。我在网上阅读了答案,我明白问题可能在于标签,但我无法解决问题。 这是XML代码,问题在第二个线性布局中。 我希望有人能帮助我 <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" andr

我不熟悉安卓系统。我在网上阅读了答案,我明白问题可能在于标签,但我无法解决问题。 这是XML代码,问题在第二个线性布局中。 我希望有人能帮助我

   <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="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="@string/hello_world"
        tools:context=".MainActivity" />

    <TextView
        android:id="@+id/TEMPERATURE_available"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/TEMPERATURE_reading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/AMBIENT_TEMPERATURE_available"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/AMBIENT_TEMPERATURE_reading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/RELATIVE_HUMIDITY_available"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/RELATIVE_HUMIDITY_reading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/LIGHT_available"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/LIGHT_reading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/PRESSURE_available"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/PRESSURE_reading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/PROXIMITY_available"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/PROXIMITY_reading"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

    <TextView
        android:id="@+id/xbox"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="X Value" />

    <TextView
        android:id="@+id/ybox"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Y Value" />

    <TextView
        android:id="@+id/zbox"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Z Value" />

    <TextView
        android:id="@+id/xboxo"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="X Value" />

    <TextView
        android:id="@+id/yboxo"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Y Value" />

    <TextView
        android:id="@+id/zboxo"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Z Value" />

</LinearLayout>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:layout_marginLeft="10dp"
    android:background="@drawable/zephyr"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="10dp"
        android:gravity="center"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/ButtonConnect"
            android:layout_width="130dp"
            android:layout_height="40dp"
            android:background="#0f0"
            android:text="@string/Connect"
            android:textSize="25sp" >
        </Button>

        <Button
            android:id="@+id/ButtonDisconnect"
            android:layout_width="130dp"
            android:layout_height="40dp"
            android:layout_marginLeft="20dp"
            android:background="#f00"
            android:text="@string/Disconnect"
            android:textSize="25sp" >
        </Button>

        <TextView
            android:id="@+id/labelStatusMsg"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginLeft="10dp"
            android:text="@string/Case"
            android:textColor="#0f0"
            android:textSize="20sp" >
        </TextView>
    </LinearLayout>

    <LinearLayout
        android:layout_width="0dp"
        android:layout_height="0dp"
        android:layout_marginTop="10dp"
        android:gravity="center"
        android:orientation="horizontal" >

        <TextView
            android:id="@+id/HRTextBox"
            android:layout_width="500dp"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/HR"
            android:textColor="#fff"
            android:textSize="60sp" />

        <TextView
            android:id="@+id/InstantSpeed"
            android:layout_width="500dp"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:text="@string/Speed"
            android:textColor="#fff"
            android:textSize="60sp" />
    </LinearLayout>

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:layout_marginTop="10dp"
        android:gravity="center_vertical"
        android:orientation="horizontal" >

        <LinearLayout
            android:layout_width="250dp"
            android:layout_height="fill_parent"
            android:gravity="left"
            android:orientation="vertical" >

            <Button
                android:id="@+id/rest"
                android:layout_width="120dp"
                android:layout_height="40dp"
                android:background="#00f"
                android:gravity="center"
                android:onClick="@+id/rest_click"
                android:text="@string/butHR0"
                android:textSize="20sp" >
            </Button>

            <TextView
                android:id="@+id/editHeartRate"
                android:layout_width="120dp"
                android:layout_height="40dp"
                android:layout_marginTop="10dp"
                android:gravity="center"
                android:text="@string/labelHeartRate"
                android:textColor="#ff0"
                android:textSize="25sp" >
            </TextView>

            <TextView
                android:id="@+id/editHeartRate2"
                android:layout_width="120dp"
                android:layout_height="60dp"
                android:layout_marginTop="30dp"
                android:gravity="center"
                android:text="@string/labelHeartRate"
                android:textColor="#fff"
                android:textSize="20sp" >
            </TextView>
        </LinearLayout>

        <LinearLayout
            android:layout_width="250dp"
            android:layout_height="match_parent"
            android:layout_gravity="right"
            android:orientation="vertical" >

            <Button
                android:id="@+id/train"
                android:layout_width="200dp"
                android:layout_height="40dp"
                android:layout_gravity="right"
                android:background="#0ff"
                android:onClick="@+id/train_click"
                android:text="@string/butHR"
                android:textColor="#000"
                android:textSize="20sp" >
            </Button>

            <LinearLayout
                android:layout_width="250dp"
                android:layout_height="60dp"
                android:layout_marginTop="10dp"
                android:gravity="right"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/HRTextBox2"
                    android:layout_width="125dp"
                    android:layout_height="match_parent"
                    android:background="#f00"
                    android:gravity="center"
                    android:text="@string/HR"
                    android:textColor="#fff"
                    android:textSize="20sp" />

                <TextView
                    android:layout_width="125dp"
                    android:layout_height="match_parent"
                    android:background="#f00"
                    android:gravity="center"
                    android:text="@string/M"
                    android:textColor="#fff"
                    android:textSize="20sp" />
            </LinearLayout>

            <LinearLayout
                android:layout_width="250dp"
                android:layout_height="40dp"
                android:gravity="right"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/labelHeartRate"
                    android:layout_width="125dp"
                    android:layout_height="fill_parent"
                    android:background="#000"
                    android:gravity="center"
                    android:text="@string/labelHeartRate"
                    android:textColor="#f00"
                    android:textSize="30sp" >
                </TextView>

                <TextView
                    android:id="@+id/labelM"
                    android:layout_width="125dp"
                    android:layout_height="fill_parent"
                    android:background="#000"
                    android:gravity="center"
                    android:text="@string/labelMet"
                    android:textColor="#0ff"
                    android:textSize="30sp" >
                </TextView>
            </LinearLayout>
        </LinearLayout>
    </LinearLayout>

    <!--
        <TextView
            android:id="@+id/labelInstantSpeed"
            android:layout_width="500dp"
            android:layout_height="fill_parent"
            android:gravity="center"
            android:text="@string/labelHeartRate"
            android:textColor="#0ff"
            android:textSize="150sp" >
        </TextView>

    -->

</LinearLayout>


亲爱的andrea不要在第二个线性布局中使用xmlns:android=“”…感谢您的回复,但问题仍然存在。最后关闭您的父线性布局,而不是在此之前。非常感谢,现在它可以工作了!欢迎Andrea.如果你需要更多帮助,你可以在我的facebook上跟我来。。。