Possible Duplicate:
How do I draw an arrowhead (in Android)?
I am trying to make a nice layout layout in android and for that I would like to connect two views with an arrow, which looks pretty much like this:
So on the start of the arrow there is supposed to be a view, and at the tip of the arrow as well.
Whats the best way to achieve this? Is the easiest just to use an image? But then I could not change the color of the arrow in android for example. Can I somehow do that with shapes?
Thank you!
Best Answer
You can use Canvas, and create your own "Arrow" view, its not too dificult, just drawLines using the right coordinates, or create a Path.
Extend
View
class, and overrideonDraw(Canvas c)
, then you should paint your lines with....
Replace the coordinates as your need, I've copy pasted the code from a view that I've created