1

I have an ImageView with rounded corners, but when I add the bitmap to it, the image doesn't have rounded corners

I have a module where I capture images, I want these images to always take the shape of the ImageView, in this case, the rounded corners, as seen in the image below.

enter image description here

XML (this is the card)

`

<LinearLayout
    android:layout_width="185dp"
    android:layout_height="185dp"
    android:background="@drawable/bg_rounded_corners"
    android:orientation="vertical">

        <ImageView
            android:id="@+id/im_producto"
            android:layout_weight=".8"
            android:layout_height="0dp"
            android:layout_width="fill_parent"
            android:layout_gravity="center"
            android:scaleType="fitXY"
            android:background="@drawable/bg_rounded_corners_top"
            android:orientation="horizontal"/>

        <Button
            android:id="@+id/btn_eliminar_fotografía"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_weight=".2"
            android:text="Eliminar"
            android:background="@drawable/bg_rounded_corners_bottom"
            android:backgroundTint="@color/purple_two"
            android:textSize="17sp"
            android:textStyle="bold"/>

</LinearLayout>

`

JAVA in the java part, I just use the set bitmap method and add the bitmap of the image

JAMSHAID
  • 1,258
  • 9
  • 32
  • does this answers your question? https://stackoverflow.com/questions/1705239/how-should-i-give-images-rounded-corners-in-android – JAMSHAID Dec 28 '22 at 03:47

0 Answers0