Here I have an ImageView with a picture installed in it ... I need to make a black edging around this picture ... Here is one screenshot of how I now have one and how I need it ... how to attach it ...

so now

enter image description here

like that

enter image description here

here is the code

 <RelativeLayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="54"> <ImageView android:id="@+id/imageView2" android:layout_width="123dp" android:layout_height="160dp" android:layout_marginStart="25sp" android:scaleType="centerCrop" android:src="@drawable/manface" /> <ImageView android:id="@+id/imageView3" android:layout_width="123dp" android:layout_height="160dp" android:layout_alignParentEnd="true" android:layout_alignParentTop="true" android:layout_marginEnd="25sp" android:scaleType="centerCrop" android:src="@drawable/womanface" /> 

    1 answer 1

    Create an xml file.

     <?xml version="1.0" encoding="UTF-8"?> <shape xmlns:android="http://schemas.android.com/apk/res/android"> <solid android:color="#FFFFFF" /> <stroke android:width="1dp" android:color="#000000" /> <padding android:left="1dp" android:top="1dp" android:right="1dp" android:bottom="1dp" /> </shape> 

    Insert this border as android:background="@drawable/black_border" into your imageView