I have a form with lots of fields and when I press the "submit" button, I'd like the scrollview to jump to the position where the unanswered field is located. Is there a method other than scrollto(x,y) to do this or such coordinates must always be mapped to the form's elements somehow ( something like (form element).getCoordinates() )?
Thanks
This should work -
view.setFocusableInTouchMode(true);
view.requestFocus();
view.requestRectangleOnScreen(viewRectangle);
You can always take a look at the View class.
P.S. The unanswered field will be selected but I'm not sure that if it is out of the screen the Activity will scroll to the requested position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With