How can you draw an arrow in Android
Answer 1, Authority 100%
Perhaps someone is useful to drawn arrogant:
Public Class Drawarrow Extends Activity {
@Override
PROTECTED VOID OnCreate (Bundle SavedInstanceState) {
Super.ONCREATE (SavedInstanceState);
SetContentView (New DrawView (this));
}
Class DrawView EXTENDS VIEW {
Paint P;
Public DrawView (CONTEXT CONTEXT) {
Super (Context);
P = New Paint ();
P.Setstrokewidth (7);
P.SetStyle (paint.style.fill_and_stroke);
}
@Override
PROTECTED VOID ONDRAW (CANVAS CANVAS) {
P.Setcolor (Color.Black);
canvas.drawpath (MAKEARROW (200,100), P);
}
}
Private Path MakeArrow (Float Length, Float Height) {// = Height / 2
Path Path = New path ();
path.reset ();
path.moveto (0.0F, Height * 0.5f);
Path.Lineto (Length, Height * 0.5f);
Path.Lineto (Length * 0.97F, Height * 0.35f);
Path.Lineto (Length * 1.2F, Height * 0.5f);
Path.Lineto (Length * 0.97F, Height * 0.65f);
Path.Lineto (Length, Height * 0.5f);
path.close ();
RETURN PATH;
}
}
Answer 2, Authority 33%
and 9-patch than not like ???