【发布时间】:2011-08-03 07:08:04
【问题描述】:
我正在尝试将 ImageView 放在显示屏的右下角。我希望图像动态扩展以适应不同尺寸的显示。
当图像较小且未设置为展开时,图像会正确对齐,但是当将其设置为 fill_parent 时,图像会向左移动并且不再与显示器的右侧对齐。
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="horizontal"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
>
<SurfaceView
android:id="@+id/surface1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
></SurfaceView>
<ImageView
android:src="@+drawable/image_1_patched"
android:layout_height="fill_parent"
android:id="@+id/imageView1"
android:layout_width="fill_parent"
android:layout_alignParentRight="true"
></ImageView>
</RelativeLayout>
如何使图像占据尽可能多的空间并保持与显示器右侧齐平?
【问题讨论】:
标签: android android-relativelayout alignment