私は2つの画像を持っています - 1)実際のコンテンツを表示する長方形の画像と2)透明な角が丸い白い画像
画像 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:
以下は、3 つの画像へのリンクです。1) 背景 2) メイン画像 3) 期待される結果 (角が丸い)