如何将ImageView置于底部背景布局中心

时间:2014-06-18 13:02:05

标签: java android xml layout

我有一个只显示背景图片的标题。

<RelativeLayout
    android:id="@+id/rl_header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/header_bg
    android:orientation="horizontal" >

我想在背景布局的底部添加一个圆形图像,并且像这样中心圆形图像!! circular image at bottom background 关于这个@Thanks

可以帮助我吗?

2 个答案:

答案 0 :(得分:0)

尝试使用android:layout_centerInParent="true"

答案 1 :(得分:0)

您可以像这样添加ImageView

<RelativeLayout
    android:id="@+id/rl_header"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:src="@drawable/header_bg"
    android:orientation="horizontal" >

    <ImageView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_alignParentBottom="true"
        android:src="{Your drawable}" />
</RelativeLayout>