(五十三) android中用xml文件画圆

1、draw_cirle.xml的代码如下所示:

<shape xmlns:android="http://schemas.android.com/apk/res/android"
    android:shape="oval" >
    <solid android:color="#999999"/>
    <size android:width="5dp"  
    android:height="5dp"/>
</shape>

2、使用的时候只要将draw_cirle.xml作为某个控件的背景就好了。例如如下所示:

<TextView
            android:layout_width="8dp"
            android:layout_height="8dp"
            android:layout_gravity="center_vertical"
            android:background="@drawable/draw_cirle" />

 

posted @ 2015-04-14 11:02  小菜美妞成长中  阅读(3112)  评论(0)    收藏  举报