我有下一個問題:我使用了很多RelativeLayout,就像Android文檔告訴我要做的那樣。但是,因爲過幾天,我不明白爲什麼,這是不工作了:RelativeLayout無法正常工作Android
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:background="@drawable/background"
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/boton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:layout_centerVertical="true"
android:text="Button" />
<TextView
android:id="@+id/textView1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/boton"
android:layout_centerHorizontal="true"
android:layout_marginTop="60dp"
android:text="Large Text"
android:textAppearance="?android:attr/textAppearanceLarge"
android:textColor="#000" />
</RelativeLayout>
這是我的佈局,非常簡單。所以,根據這個,textView應該在按鈕之下,但是,相反,它會出現在按鈕上!
。
誰有解釋我會發生什麼?
編輯:這個問題是不是當我嘗試在設備上運行它,問題就來了,當我看到它在ADT Eclipse插件的圖形佈局...
難道你結束'RelativeLayout',你的代碼是爲我工作。 ' RelativeLayout>' – jnthnjns
你的代碼對我來說也很好。 你是否結束了相對佈局標籤Asok說 –
工作正常關閉相對佈局標籤。 – Raghunandan