2015年6月15日 星期一

android:layout_below

Force the control located below another control as follows:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"    
                xmlns:tools="http://schemas.android.com/tools"    
                android:layout_width="fill_parent"    
                android:layout_height="fill_parent"    
                android:orientation="vertical" >
    <Button android:id="@+id/button1"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/button1" />
    <Button android:id="@+id/button2"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
           android:layout_below="@id/button1"
           android:text="@string/button2" />
    <TextView android:id="@+id/textView1"
              android:layout_width="match_parent"
              android:layout_height="match_parent"
             android:layout_below="@id/button2"/>

</RelativeLayout>

1 則留言: