Fede
Fede

Reputation: 1716

Draw a line between objects in Android

Hello I have a layout with x number of buttons created dinamically. What i need to do is draw a line that join the first and the last button. How can i get position of the buttons, and how can i draw the line? Thanks!

Upvotes: 3

Views: 900

Answers (1)

ace-jc
ace-jc

Reputation: 11

This is how you draw the line:

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

This is done to the canvas object in the onDraw method.

Here is more information:

Upvotes: 1

Related Questions