0
Method for put arrow in specific degree in Android studio ?
I need method to put arrow of compass in specific degree like 102° how i Can Do it
1 Réponse
+ 2
Use svg or have a look about canvas to draw
do something like that
for (float angle = 0; angle < 361; angle = angle + pointAngle)
{ //move round the circle to each point
float displacedAngle = angle - 90;
float x = cx + ((float)Math.Cos(radians(displacedAngle)) * radius); //convert angle to radians for x and y coordinates
float y = cy + ((float)Math.Sin(radians(displacedAngle)) * radius);
canvas.DrawLine(cx, cy, x, y, paint); //draw a line from center point back to the point
}