我有两张图片 - 1)一个矩形的,显示实际内容,2)一个带圆角透明的白色图像。
是否可能将图像1放置在图像2中,保持其大小但使其成为与图像2相同的形状?
基本上我想让图像2成为图像1的容器。
我尝试过层和插入可绘制对象,但每次图像1都会重叠在图像2上。
提前致谢!
更新1:
这是我的ImageView xml部分:
是否可能将图像1放置在图像2中,保持其大小但使其成为与图像2相同的形状?
基本上我想让图像2成为图像1的容器。
我尝试过层和插入可绘制对象,但每次图像1都会重叠在图像2上。
提前致谢!
更新1:
这是我的ImageView xml部分:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="wrap_content"
android:layout_height="72dp"
android:orientation="horizontal">
<ImageView
android:id="@+id/avatar"
android:src="@drawable/mainImg"
android:background="@drawable/backgroundImg"
android:layout_width="56dp"
android:layout_height="56dp"
android:layout_gravity="center"
android:contentDescription="@string/desc" />
</LinearLayout>
更新2:
以下是三张图片的链接: 1)背景图 2)主图 3)期望的结果(带圆角)