I see many examples of that using implementations and mathematics calcs.
I would like to show my soft way to do this.
Create a CardView object and insert inside it an ImageView object, like this:
The trick is: the
from CardView will create a rounded borders and will get the size of its son, the ImageView.
In programming time, the image will stay in your real format, but in execution time, the CardView will round the image.
I would like to show my soft way to do this.
Create a CardView object and insert inside it an ImageView object, like this:
HTML:
<androidx.cardview.widget.CardView
android:id="@+id/cardLogo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="100dp"
android:elevation="0dp"
android:outlineSpotShadowColor="#fff"
>
<ImageView
android:id="@+id/imgProfile"
android:layout_width="200dp"
android:layout_height="200dp"
android:src="AnyImageYouWant"
/>
</androidx.cardview.widget.CardView>
HTML:
app:cardCornerRadius="100dp"
In programming time, the image will stay in your real format, but in execution time, the CardView will round the image.