<RelativeLayout xmlns:android=”http://schemas.android.com/apk/res/android”
android:layout_width=”match_parent”
android:layout_height=”match_parent” >
<TextView
android:id=”@+id/textView1″
android:layout_width=”wrap_content”
android:layout_height=”wrap_content”
android:layout_alignParentLeft=”true”
android:layout_alignParentTop=”true”
android:text=”Choose an Image” />
<Button
android:id=”@+id/loadPhotoButton”
android:layout_width=”match_parent”
android:layout_height=”wrap_content”
android:layout_alignParentBottom=”true”
android:text=”Load New Photos”/>
<GridLayout
android:layout_below=”@id/textView1″
android:layout_above=”@id/loadPhotoButton”
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:columnCount=”3″ >
<ImageView
android:id=”@+id/imageView1″
android:src=”@drawable/logo” />
<ImageView
android:id=”@+id/imageView2″
android:src=”@drawable/logo” />
<ImageView
android:id=”@+id/imageView3″
android:src=”@drawable/logo” />
</GridLayout>
</RelativeLayout>
10
10
30
把GridLayout 换成LinearLayout,然后设置 android:layout_weight=”1″ ,3等分就行了
<LinearLayout
android:layout_width=”match_parent”
android:layout_height=”match_parent”
android:layout_above=”@id/loadPhotoButton”
android:layout_below=”@id/textView1″
android:orientation=”horizontal” >
<ImageView
android:id=”@+id/imageView1″
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/aaa” />
<ImageView
android:id=”@+id/imageView2″
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/aaa” />
<ImageView
android:id=”@+id/imageView3″
android:layout_width=”0dp”
android:layout_height=”wrap_content”
android:layout_weight=”1″
android:src=”@drawable/aaa” />
</LinearLayout>