我要設計這種特殊的設計如何設計這個佈局,android?
這裏B1,B2 & B3是按鈕和E1是編輯文本
我已經試過如下
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<LinearLayout
android:id="@+id/linearLayout1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:background="@color/Red"
android:orientation="vertical" >
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="0dip"
android:layout_marginBottom="20dp"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_weight="1" >
<Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_below="@+id/editText1"
android:layout_marginRight="20dp"
android:background="@drawable/btn_shape1"
android:drawableRight="@drawable/arrow_select"
android:text="B1" />
<EditText
android:id="@+id/editText1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/button1"
android:background="@drawable/btn_shape1"
android:ems="10" />
</RelativeLayout>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:background="@color/Red" >
<Button
android:id="@+id/button2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentLeft="true"
android:layout_marginBottom="10dp"
android:layout_marginLeft="19dp"
android:layout_marginTop="10dp"
android:background="@drawable/btn_shape1"
android:text="B2" />
<Button
android:id="@+id/button3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_marginBottom="10dp"
android:layout_marginRight="19dp"
android:layout_marginTop="10dp"
android:background="@drawable/btn_shape1"
android:text="B3" />
</RelativeLayout>
<ImageView
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_centerInParent="true"
android:src="@drawable/ic_launcher" />
</RelativeLayout>
但我沒有得到與設計相同的結果。
是B2和B3在屏幕的底部,ImageView應該佔用其餘的空間嗎?或B2和B3只是在Imageview下面,而不是與底部對齊? – Sharj
B2和B3位於屏幕的底部,ImageView應占用其餘空間 – WISHY