github地址:[https://github.com/hdodenhof/CircleImageView](https://github.com/hdodenhof/CircleImageView)
有些场景需要圆形图片,比如个人中心的头像。
#### 引入
~~~
implementation '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/ic_launcher_background"
app:civ_border_width="2dp"
app:civ_border_color="#FF000000"/>
~~~
其中可以修改边框尺寸、颜色等。同时可以作为一个imageview在java代码中赋值图片。