Draw a line between objects in Android

Hello I have a layout with a number of buttons created dynamically. What I need to do is draw a line connecting the first and last buttons. How can I get the position of the buttons, and how can I draw a line? Thank you!

+3


source to share


1 answer


This is how you draw the line:

canvas.drawLine(startPoint.x, startPoint.y, endPoint.x, endPoint.y, paint);

      



This is done for the canvas object in the method onDraw

.

Here more information:

+1


source







All Articles