Skip to content Skip to sidebar Skip to footer

How Can I Make Rounded (circled) Imageview Box On Android Studio?

I am trying to create rounded shape Image-view not the square shape in Android Studio (like the one from Whats-app). This is my xml file

Solution 1:

Create a xml file e.g circle_shape.xml in your drawable folder and write the following code something like this

<?xml version="1.0" encoding="utf-8"?><shapexmlns:android="http://schemas.android.com/apk/res/android"android:shape="oval"><solidandroid:color="@color/colorRound"/><sizeandroid:width="50dp"android:height="50dp"/></shape>

then use this circle_shape.xml in your imageView as background something like this

<ImageView
    android:layout_width="150dp"
    android:layout_height="150dp"
    android:id="@+id/imageView2"
    android:src="@drawable/logo"
    android:layout_marginTop="64dp"
    android:layout_alignParentTop="true"
    android:layout_centerHorizontal="true"
    android:adjustViewBounds="false"
    android:background="@drawable/circle_shape"
    android:clickable="false" />

Post a Comment for "How Can I Make Rounded (circled) Imageview Box On Android Studio?"