首页 > 代码库 > Android - shape不完整的圆环(ring)

Android - shape不完整的圆环(ring)

shape不完整的圆环(ring)


本文地址: http://blog.csdn.net/caroline_wendy


Android不仅可以画圆环(ring), 也可以使用属性"android:thicknessRatio", 画不完整的圆环.
thicknessRatio属性值设为浮点小数, 如1.9, 即可以得到不完整的圆环.

代码:

<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
       android:innerRadius="0dp"
       android:shape="ring"
       android:thicknessRatio="1.9"
       android:useLevel="false" >

    <solid android:color="@android:color/transparent" />

    <size android:width="100dp"
          android:height="100dp"/>

    <stroke android:width="1dp"
            android:color="#FFFFFF"/>

</shape>





Android - shape不完整的圆环(ring)