github:https://github.com/hdodenhof/CircleImageView。
依赖:
dependencies {
...
compile 'de.hdodenhof:circleimageview:2.2.0'
}
代码:
<de.hdodenhof.circleimageview.CircleImageView xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/profile_image" android:layout_width="96dp" android:layout_height="96dp" android:src="@drawable/profile" app:civ_border_width="2dp" app:civ_border_color="#FF000000"/>效果: