Hi,
I have found some Java code that will give the x,y coordinates of the cursor in an EditText view.
Please can someone give me a few pointers as to how I declare editText in my library, so it points at my EditText1 view on my actual B4A activity.
(Or is this more easily done with Reflection, from with B4A)?
Any help would be greatly appreciated!
I have found some Java code that will give the x,y coordinates of the cursor in an EditText view.
B4X:
int pos = editText.getSelectionStart();
Layout layout = editText.getLayout();
int line = layout.getLineForOffset(pos);
int baseline = layout.getLineBaseline(line);
int ascent = layout.getLineAscent(line);
float x = layout.getPrimaryHorizontal(pos);
float y = baseline + ascent;
Please can someone give me a few pointers as to how I declare editText in my library, so it points at my EditText1 view on my actual B4A activity.
(Or is this more easily done with Reflection, from with B4A)?
Any help would be greatly appreciated!