quotation

Good evening, I’m Kitty. My public account “Cainiao Turn over” will recommend interesting projects on GitHub to explore the value of open source. Welcome to follow me.

According to uCrop, image cropping is one of the most common features in Android development, and circular images are also very common, often used for personal images.

Today’s recommended circular image library is CircleImageView, which is also the circular image library used in my actual project. I will not hide it and share it with you selflessly. Remember to pay attention to my public number oh, dry goods are constantly recommended.

Results the preview

Use the sample

Introduce CircleImageView library.

dependencies {
    ...
    implementation 'DE. Hdodenhof: circleimageview: 3.1.0'
}
Copy the code

2. Use circular images where necessary.

<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"/>
Copy the code

Is not the use of very simple ah, quickly use, the so-called predecessors plant trees descendants good shade, a lot of times do not need to understand too much principle, just stand on the giant’s Ding Ding can, of course, you say your ability is strong, not to repeat the wheel, beyond blame.

Making the address

Github.com/hdodenhof/C…

More articles please pay attention to public number: rookie turn over.