I have a custom EditText that in its touch event wrote the code for display keyboardview.now I can’t scroll it and with click on it can’t locate cursor in touched position.I find code for locate cursor in touched position that it work correct only when edittext did not scroll.
code is:
Layout layout = ((EditText) text).getLayout();
if (layout != null)
{
int line = layout.getLineForVertical((int) event.getY());
int offset = layout.getOffsetForHorizontal(line, event.getX());
((EditText)text).setSelection(offset);
}
please help me
thanks
You need to add 2 scrollView(as Royston said) inside 1 layout (the consequence is on some phone it appears to be laggy)
Here are some code snippet for that:
first on xml
And add this on code behind