Android quickly sets up circular images

  1. Import CircleImageView library
dependencies {
    ...
    implementation 'com.github.huangziye:CircleImageView:${latest_version}'. }Copy the code
  1. Use the CircleImageView tag in XML
<com.hzy.circle.CircleImageView
        android:layout_width="100dp"
        android:layout_height="100dp"
        android:src="@mipmap/a"
        android:layout_marginTop="10dp"
        app:civ_border_width="2dp"
        app:civ_border_color="@color/colorAccent"/>
Copy the code

rendering