使用shape画圆,在drawanle文件加下创建circle.xml文件
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<stroke
android:width="1dip"
android:color="@color/c_fff"/>
<solid android:color="@color/transparent" />
</shape>
调用时是android:background="@drawable/circle"
效果如下,我的背景是黑色的,圆形中间的透明的,如果想设置成带颜色的可以改circle.xml中solid的颜色,stroke是对边框的样式的设置。