2014-10-27 71 views
0

我遇到問題。我試圖創建一個應用程序,但我得到一個錯誤,我真的不知道如何解決它。它在EditText之前給出了一個紅色叉號,我認爲它與所有的打開/關閉方式有關,但我無法找到問題。LinearLayout給出錯誤

<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_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" /> 



    /> 

想聽聽你的意見。

+0

缺少'>'在第一'LinearLayout'標籤的結束。結束標籤應該是''而不是'/>' – codeMagic 2014-10-27 15:44:00

回答

0

這是你的問題

你離開>收盤標誌上的線性佈局。

這是正確的方式

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

     <!--items go here --> 
    </LinearLayout> 
0

LinearLayout中應該有一個開放和關閉標籤:

<LinearLayout 
    attributes here...> 
....stuf there... 
</LinearLayout>