我創建了一個按鈕佈局設計,如圖所示。我如何實現不同尺寸屏幕的設計模式?這種佈局適合3.7英寸的屏幕,但不適用於其他屏幕。可能是scrollview是一個選項,但這並不能滿足我。我該怎麼做?任何幫助?需要針對不同類型設備的相同設計android
這是我的xml文件
<RelativeLayout 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"
tools:context=".MainActivity" >
<Button
android:id="@+id/button1"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_alignParentTop="true"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Button" />
<Button
android:id="@+id/button2"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_below="@+id/button1"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Button" />
<Button
android:id="@+id/button3"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_below="@+id/button2"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Button" />
<Button
android:id="@+id/button4"
android:layout_width="match_parent"
android:layout_height="110dp"
android:layout_below="@+id/button3"
android:layout_centerHorizontal="true"
android:layout_marginTop="5dp"
android:text="Button"
android:layout_marginBottom="5dp" />
它甚至沒有顯示按鈕:-( – 2013-03-20 05:47:49
我編輯我的代碼..現在試試這個 – user1835052 2013-03-20 05:49:22
你試過我的代碼... – user1835052 2013-03-20 05:56:39