У меня есть вид с несколькими детьми. Я бы хотел, чтобы у всей группы были закругленные углы, например:
![enter image description here](https://i.stack.imgur.com/fT0Bk.jpg)
Я пытаюсь сделать это давая родительскому LinearLayout и его закругленным углам ImageView через их фоны
LinearLayout и потомки:
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginTop="20dp"
android:layout_marginRight="20dp"
android:background="@drawable/tile_background"
android:elevation="1dp"
android:orientation="vertical">
<ImageView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/image_frame_sponsorship"
android:coverTileUrl="@{sponsorship.coverTileUri}">
</ImageView>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:gravity="center_vertical"
android:paddingLeft="20dp">
<TextView
android:id="@+id/postActionText"
style="@style/ActionFont"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="6dp"
tools:text="@string/watch_respond">
</TextView>
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:src="@drawable/ic_chevron_right_black_36dp">
</ImageView>
</RelativeLayout>
</LinearLayout>
Фон LinearLayout:
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#FFFFFF" />
<stroke
android:width="1dp"
android:color="#D2DADC" />
<corners android:radius="10dp" />
<padding
android:bottom="0dp"
android:left="0dp"
android:right="0dp"
android:top="0dp" />
</shape>
Фон ImageView:
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<corners
android:topLeftRadius="10dp"
android:topRightRadius="10dp"/>
<solid android:color="@android:color/white" />
<stroke
android:width="1dp"
android:color="@color/white" />
</shape>
LinearLayout принимает закругленные углы, но верхние два угла imageView не переполняют углы и, очевидно, границы своего родителя:
Как заставить ImageView вести себя?