我想创造类似的东西:
删除图片
我尝试使用相对布局,当我将图像和背景视图对齐到顶部
时并将边距应用于bg视图:
<RelativeLayout
android:id="@+id/fieldLinearLayout"
android:layout_width="match_parent"
android:layout_height="80dp" >
<ImageView
android:id="@+id/mood"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_above="@+id/fieldLinearLayout1"
android:layout_alignParentTop="true"
android:layout_marginTop="20dp"
android:src="@drawable/signup_illu_verificationcode" />
<LinearLayout
android:id="@+id/fieldLinearLayout1"
android:layout_width="match_parent"
android:layout_height="60dp"
android:layout_alignParentTop="true"
android:layout_marginTop="25dp"
android:background="#f9ffff"
android:orientation="vertical" >
但它不起作用,bg覆盖了图像。
我该如何解决?
答案 0 :(得分:0)
您可以尝试使用负边距来移动ImageView。
答案 1 :(得分:0)
您是否尝试使用FrameLayout?使用FrameLayout,您可以按添加项目的顺序决定z-index。第一项将位于底部,最后一项将位于顶部。