圆形的父边框不适用于孩子

时间:2016-07-17 19:01:48

标签: android android-layout

当我使用此xml布局制作带圆角边框的第一个布局时

 <shape xmlns:android="http://schemas.android.com/apk/res/android">
<solid android:color="#00ffffff"/>

<stroke android:width="3dp"
    android:color="#ffffff"
    />

<padding android:left="1dp"
    android:top="1dp"
    android:right="1dp"
    android:bottom="1dp"
    />

<corners android:bottomRightRadius="15dp" android:bottomLeftRadius="15dp"
    android:topLeftRadius="15dp" android:topRightRadius="15dp"/>
 </shape>

它使我的布局边框变圆,但是孩子它的圆角边框 看图像

父边框是圆形的,但是它的圆形边框是如何解决的?

enter image description here

另一张图片

enter image description here

1 个答案:

答案 0 :(得分:0)

实际上你并没有绕过你只是为你的视图设置一个圆角背景而且布局仍然是一个矩形。

您可以为子视图设置相同的背景,或使用此post中提到的剪辑。