我正在尝试使用RelativeLayout将按钮与屏幕的左下角和右下角对齐。我想这样做是为了在不同的屏幕尺寸上保持相同的相对布局。目前,我屏幕上的按钮根据屏幕的分辨率向上/向下移动。320x480使按钮在屏幕上的位置高于480x800。我试着让我的屏幕在两种尺寸下看起来是一样的。
发布于 2011-01-14 00:33:25
示例:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:panel="http://schemas.android.com/apk/res/it.kronplatz"
android:id="@+id/MainLayout"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
<RelativeLayout
android:id="@+id/ButtonLayout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_centerHorizontal="true"
android:baselineAligned="false" >
<ImageButton
android:id="@+id/locateMeButton"
android:layout_width="70px"
android:layout_height="70px"
android:layout_marginLeft="5px"
android:src="@drawable/me" >
</ImageButton>
<ImageButton
android:id="@+id/MapCenterButton"
android:layout_width="70px"
android:layout_height="70px"
android:layout_alignParentRight="true"
android:layout_gravity="right"
android:layout_marginRight="5px"
android:src="@drawable/fadenkreuz_klein" />
<Button
android:id="@+id/MapNextButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:drawableRight="@drawable/androidmarker" >
</Button>
</RelativeLayout>
</RelativeLayout>https://stackoverflow.com/questions/4674416
复制相似问题