http://www.open-open.com/lib/view/open1392016780239.html
下载的项目包内找到CircleImageView.java:
一、直接将CircleImageView.java导入到自己的项目中使用。导入后需要添加一个配置文件
在value中新建 styleable.xml,xml代码如下:
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="CircleImageView">
<attr name="border_width" format="dimension" />
<attr name="border_color" format="color" />
</declare-styleable>
</resources>
二、在布局文件中可以直接使用CircleImageView:
<com.wiiun.view.CircleImageView
android:id="@+id/story_list_item_avatar"
android:layout_width="60dip"
android:layout_height="60dip"
android:background="@color/white"
android:src="@drawable/ic_contact_avatar"
android:contentDescription="@string/about_label_help" />
注意:使用时不可以设置scaleType,否则报错。
图片: