android 圆角背景

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="rectangle">
    <!-- 设置按钮的左上角和右下角为弧形 -->
    <stroke android:color="@color/colorNewRed"
        android:width="1dp" />
    <solid android:color="@color/colorNewRed" />
    <corners android:topLeftRadius="15dip"
        android:bottomRightRadius="15dip" />
</shape>
相关属性:
corners:圆角弧度    
solid:里面背景 stroke:外框背景 padding:文字与边框的距离 shape:背景整体类型,取值有 rectangle(矩形) oval(椭圆形) line(线性) ring(环形)

 

posted @ 2019-02-11 09:40  zty_Love  阅读(5182)  评论(0编辑  收藏  举报