【发布时间】:2012-03-07 08:24:43
【问题描述】:
我想在视图的右侧放置一个图像。为此,我很想使用类似的东西
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >
...some other elements
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
>
<ImageView
android:id="@+id/imageIcon"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:src="@drawable/image_icon" >
</ImageView>
</LinearLayout>
...
</RelativeLayout>
以上似乎将图像放在中心的某个位置。无论我们处于纵向还是横向模式,如何确保图像正确对齐?
谢谢!
【问题讨论】:
标签: android alignment android-linearlayout