layout - How to get the exact coordinate of a view in android? -


I want to make an app where users can add two text to a lesson; For example, when a user clicks in the left text view, and the app should automatically generate a line in the correct text view, the problem I have is to find out the exact coordination of two ideas that I received in the top ( ) Have tried to use. . But always the position of the arrow does not get in the right place, similarly similar onscin ();

  ... iv = (ImageView) findViewById (R.id.imageView1); D = getWindowManager () GetDefaultDisplay (); Float dw = d.getWidth (); Float DH = D.GHight (); Bit = bitmap.creditbetaMap ((int) dw, (int) DH, bitmap config. ARGb_8888); Can = new canvas (bit); Paint = new paint (); Paint.setColor (Color.BLACK); iv.setImageBitmap (bit); Button = (button) Find VibibIID (R.B. button 1); Click Button.setOnClickListener (New OnClickListener) {@Override Public Zero (see V) {button text = (button) findViewById (R.id.button2); can.drawLine (text.getLeft () + text.getWithth (), Text.getTop () + (text.getHeight () / 2), button .getLeft (), button .Gettap () + (button .getWidth () / 2), paint); iv.invalidate ();}}); }}    

You have tried textView.getX (); For X coordination and textview.getY () for Y coordination ...

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -