1

I tried to add a thin border around my rounded imageView. To do this, i decided to add a shape as background with a padding. The result is good, there is a thin border around my imageview but this border is so small. I would like to have a border around 3dp.

I tried to play with different size (padding, corner) but the result is not good. Perhaps, there is a problem in my xml :

shape_rounded.xml :

<stroke android:width="5dp"
    android:color="#000000"
    />

<padding android:left="3dp"
    android:top="3dp"
    android:right="3dp"
    android:bottom="3dp"
    />

<corners android:bottomRightRadius="30dp" android:bottomLeftRadius="30dp"
    android:topLeftRadius="30dp" android:topRightRadius="30dp"/>

And here is how i use it :

<com.frisbeeeapp.frisbeee.utilities.RoundedImageView
        android:id="@+id/img_ex"
        android:layout_width="35dp"
        android:layout_height="35dp"
        android:gravity="center"
        android:background="@drawable/shape_rounded"
        android:scaleType="centerCrop"
        android:src="@drawable/cover2"
        android:layout_gravity="center_vertical" />
jww
  • 97,681
  • 90
  • 411
  • 885
wawanopoulos
  • 9,614
  • 31
  • 111
  • 166

1 Answers1

1

I believe it will help with this:

<solid android:color="#00000000" />
<stroke android:width="8dp"
         android:color="#000000"/>
<corners android:radius="30dp" />
T D Nguyen
  • 7,054
  • 4
  • 51
  • 71