I am fresher in android so I don't know how to set color of circle image boundary in android. Please can any one suggest me?
Asked
Active
Viewed 263 times
0
-
Explain in more details with what you tried yet. – Shyam Jan 25 '14 at 11:34
-
did you mean circle draw in canvas ?? – Chirag Ghori Jan 25 '14 at 11:34
-
![enter image description here][1] [1]: http://i.stack.imgur.com/0Hyu8.png on this circle image i want green boundary – NeelamGoyal Jan 25 '14 at 11:39
-
Check these http://stackoverflow.com/questions/18527467/mask-imageview-with-round-corner-background , http://stackoverflow.com/questions/17881104/mask-imageview-with-a-shape – zapdroid Jan 25 '14 at 11:45
-
thanks @zapdroid my problem is solved with your this link – NeelamGoyal Jan 25 '14 at 11:55
1 Answers
0
There are number of ways to achieve the same thing. 1. Layering 2. Placing images inside a relative layout.
The example could be like below.
<RelativeLayout
android:layout_width="200dp"
android:layout_height="200dp" >
<ImageView
android:layout_width="160dp"
android:layout_height="160dp"
android:layout_centerInParent="true"
android:src="@drawable/bg_circle" />
<ImageView
android:layout_width="200dp"
android:layout_height="200dp"
android:layout_centerInParent="true"
android:src="@drawable/rotatetrans" />
</RelativeLayout>
I have created a project to demonstrate both approaches. you may consider taking a look at it. Hope it helps.
https://github.com/gansBhat/AndroidProjects/tree/master/Examples/ImageWithBorder
Take a look at layout file activity_main.xml
and ImageWithBorder\res\drawable\layeredImage.xml in the example. You can figure it out.

Ganesh Bhat
- 243
- 2
- 10