Friends How To Display Border To Imageview ?
I Want To Result Like Mobile gallery all image display with border.
plz give me ans thanks for advance....
You can create a resource (layer drawable xml) for your ImageView
's "border" (actually background), and declare in your theme
that the ImageView
's background resource is the drawable xml.
If you need this "border" to be changed based on the ImageView
's state (focused
, selected
, etc.), then you should create more layer drawables, and put them together into a selector xml (state drawable).
Then in your theme you should set the ImageView
's background to be this selector.xml
.
Update
Below is a sample of how to specify a simple border to your images, that will result in
You have to
image_border.xml
),styles.xml
filecolors.xml
fileImageView
.res/drawable/image_border.xml
-
-
res/values/styles.xml
Add the following lines:
res/values/colors.xml
Add the following lines:
#40990000
#FF660000
#FFFF3333
And finally specify the style of your ImageView
in your layout xml: