解析XML时出错:标记不匹配

时间:2017-08-03 23:23:48

标签: android xml

我有这个xml但我无法编译该文件,我无法识别错误。 它说错误解析XML:不匹配的标签,我使用材料设计和CoordinatorLayout。 我当前版本的Android Studio是2.2.3,我正在使用AppCompat,所以我可以在以前的Lollipop Android版本中使用Material Design

<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    tools:context="com.isalvinator.platzigram.view.CreateAccountActivity">

    <include layout="@layout/actionbar_toolbar">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:fillViewport="true"
        app:layout_behavior="@string/appbar_scrolling_view_behavior">

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:orientation="vertical"
            android:padding="@dimen/activity_vertical_margin">

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/TextEditBlack"
                android:layout_marginTop="10dp">

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/email"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Correo"
                    android:inputType="textWebEmailAddress"/>
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/TextEditBlack"
                android:layout_marginTop="10dp">

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Nombre"
                    />
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/TextEditBlack"
                android:layout_marginTop="10dp">

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/username"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Usuario"/>
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/TextEditBlack"
                android:layout_marginTop="10dp">

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/password_createaccount"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Contraseña"
                    android:inputType="textPassword"/>
            </android.support.design.widget.TextInputLayout>

            <android.support.design.widget.TextInputLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:theme="@style/TextEditBlack"
                android:layout_marginTop="10dp">

                <android.support.design.widget.TextInputEditText
                    android:id="@+id/confirmPassword"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:hint="Confirma contraseña"
                    android:inputType="textPassword"/>
            </android.support.design.widget.TextInputLayout>

            <Button
                android:id="@+id/joinUs"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:text="Únete"
                android:theme="@style/RaisedButtonDark" />

        </LinearLayout>
    </ScrollView>

    </android.support.design.widget.CoordinatorLayout>

1 个答案:

答案 0 :(得分:3)

您尚未关闭include代码

所以错误只是在

<include layout="@layout/actionbar_toolbar">

关闭此标记,你应该很好