Android_shape分析

来源:互联网 发布:重庆时时彩预测软件 编辑:程序博客网 时间:2024/06/05 17:14

Stroke:描边用的,共四个属性值,分别为:width,dashWidth,dashGap,color。dash的英文意思为破折号,即用来画虚线的。

width:用来设置边框的宽度

dashWidth:用来设置虚线框的宽度

dashGap:用来设置虚线之间的间隔。

color:用来设置边框的颜色

如果dashWidth,dashGap为0,则边框为实线线

    <stroke
        android:dashGap="5sp"
        android:dashWidth="10sp"
        android:width="5sp"
        android:color="#f00" >
    </stroke>


corners:用来画四个角的半径的,共5个属性值,分别为:topLeftRadius,topRightRadius,bottomLeftRadius,bottomRightRadius,radius。


solid:用来填充的。只有一个属性color。

    <stroke
        android:width="10sp"
        android:color="#f00" >
    </stroke>


    <corners android:topLeftRadius="6sp" />


    <solid android:color="#00FF00" />



0 0