drawing a line between two buttons on dialog fragment

时间:2019-01-18 18:56:04

标签: android android-dialogfragment ondraw line-drawing

i have two buttons on a dialog fragment. They are both from the same custom view.

During the ondraw of each button i grab the screen coordinates of each and retain them via a setter. I use getwindowlocation for this task.

I then have a custom line that loads. On it's ondraw I 'get' the coordinates from the two buttons and use them as the begin and endpoints of the drawline method. The line draws from center point to center point.

This all works fine but when the line is drawn it looks to be offset to the right a little bit.

Is there something I'm not considering when I get the button coordinates. Perhaps a built in margin on the dialog fragment or something like that?

thanks for the help

0 个答案:

没有答案