2014-10-31 74 views
-3

我是新来的Android应用程序的开发,我想建立一个简单的界面,但它让我看到下面的错误Element type "EditText" must be followed by either attribute specifications, ">" or "/>"元素类型“的EditText”必须遵循的任一属性规范“>”或“/>”

<?xml version="1.0" encoding="utf-8"?> 
    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 
    android:layout_width="match_parent" 
    android:layout_height="match_parent" 
    android:orientation="horizontal" > 
    <EditText android:id="@+id/edit_message" 
    android:layout_width="wrap_content" 
    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> 
+1

关闭您的编辑文本 – Namy 2014-10-31 06:54:48

+0

错误消息不能更容易理解的家伙,元素类型“EditText”后面必须跟有属性规格,“>”或“/>” – Siddharth 2014-10-31 06:56:50

+0

好工作@Sumit Sharma你给了关闭像Button和LinearLayout这样的其他视图的标签,但令人惊讶的是没有给EditText一个很好的成就。 – 2014-10-31 07:12:58

回答

5

不是一个Android的怪胎,但作为一个XML用户您的EditText代码可能是

<EditText android:id="@+id/edit_message" 
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:hint="@string/edit_message" /> <-- 

缺少结束标记。您必须添加/>,就像您对Button所做的操作一样。

相关问题