Question

How to a create a drawable of a circle, with blue stroke of 5 pixels and a transparent fill.

I will be passing this drawable to an ItemizedOverlay .

I want to do this with code and I will know the radius of the circle.

Was it helpful?

Solution

Try something along the lines of:

<shape xmlns:android="http://schemas.android.com/apk/res/android" 
       type="OvalShape" >
   <stroke android:width="5dp" android:color="#99104E8B"/>
   ....
</shape>

Just put something like this in an XML file in you drawables directory and load it as you would a normal image.

See ShapeDrawable in the Android Docs.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top