我想让一个ImageView
覆盖在另一个ImageView
上面,就像这样;只有圆形的一半绿色覆盖在图像上:
我已经尝试使用RelativeLayout
并将两个ImageView
放入其中。然后我通过使用android:layout_alignBottom
将圆形覆盖在图像上。它确实覆盖了,但我不知道如何设置偏移量,以便只有圆形的一半覆盖在基础图像上。
编辑:
对不起,这是我的布局XML代码
<RelativeLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_marginBottom="32sp" >
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:src="@drawable/ic_person_black"
android:adjustViewBounds="true"
android:id="@+id/image_view_product" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@id/image_view_product"
android:layout_centerHorizontal="true"
android:background="@drawable/image_view_circle"
android:src="@drawable/ic_circle" />
</RelativeLayout>