XML document structure must start and end within the same entity

前端 未结 3 1929
离开以前
离开以前 2021-01-17 05:50

I\'m quite a newbie for the eclipse, and I\'m just started to write some code(actually it\'s just copy and paste from the website) can anyone help me about this??? *the erro

相关标签:
3条回答
  • 2021-01-17 06:42

    XML document structure must start and end within the same entity, as you can see, there's a < ToggleButton .... > and a < /ToggleButton > which make a pair, but < LinearLayout .... > still needs something to make a pair.

    I think it's better for you to have a better understanding of XML, it's quite easy and useful.here's a good tutorial:

    https://developer.mozilla.org/en/docs/XML_Introduction

    0 讨论(0)
  • 2021-01-17 06:51

    use this code :

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical" >
    
        <ToggleButton
            android:id="@+id/toggleButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            >
    
        </ToggleButton>
    </LinearLayout>
    
    0 讨论(0)
  • 2021-01-17 06:54

    You need to close the LinearLayout tag.

    <?xml version="1.0" encoding="utf-8"?>
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="match_parent"
        android:gravity="center"
        android:orientation="vertical" >
    
        <ToggleButton
            android:id="@+id/toggleButton1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            >
    
        </ToggleButton>
    </LinearLayout>
    
    0 讨论(0)
提交回复
热议问题