Android radius上边两个圆角,底下是方角的实现

做无线查房系统时,遇到一个按钮是上面两个圆角,下面两个方角类似标签的图片,一开始设置为:

<corners
android:topLeftRadius="8dip"
android:topRightRadius="8dip"
android:bottomLeftRadius="0dip"
android:bottomRightRadius="0dip"/>

结果发现整个按钮背景不显示,后修改为:

<corners
android:topLeftRadius="8dip"
android:topRightRadius="8dip"
android:bottomLeftRadius="1dip"
android:bottomRightRadius="1dip"/>
<padding
android:left="0dip"
android:right="0dip"
android:top="0dip"
android:bottom="0dip"/>

添加了padding属性后,可以正常显示了。

posted @ 2015-10-10 16:26  山水涧  阅读(1689)  评论(0编辑  收藏  举报