Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Border for an Image view in Android?

How can I set a border for an ImageView and change its color in Android?

like image 555
Praveen Avatar asked Jul 16 '10 09:07

Praveen


People also ask

How to give border to image in android?

When the image is loaded, you will see a scrollable toolbar at the bottom of your screen. There you will find the Border tool. Click on it. This should reveal a new window where you can choose the color and thickness of your border.


1 Answers

I set the below xml to the background of the Image View as Drawable. It works.

<?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> 

And then add android:background="@drawable/yourXmlFileName" to your ImageView

like image 83
Praveen Avatar answered Sep 30 '22 18:09

Praveen