T201016 Active Member Licensed User Longtime User Sep 24, 2021 #1 Hi! Is it possible to be able to set the cursor to the "Y" position in EditText or FloatLabeledEditText? I miss just such a method "edittext.scrollY() ..."
Hi! Is it possible to be able to set the cursor to the "Y" position in EditText or FloatLabeledEditText? I miss just such a method "edittext.scrollY() ..."
William Lancee Well-Known Member Licensed User Longtime User Sep 24, 2021 #2 For B4XFloatTextfield.Textfield and EditText1 B4X: Copy B4XFloatTextField1.TextField.RequestFocus B4XFloatTextField1.TextField.SetSelection(cursorPosition, 0) EditText1.RequestFocus EditText1.SetSelection(cursorPosition, 0) Upvote 2
For B4XFloatTextfield.Textfield and EditText1 B4X: Copy B4XFloatTextField1.TextField.RequestFocus B4XFloatTextField1.TextField.SetSelection(cursorPosition, 0) EditText1.RequestFocus EditText1.SetSelection(cursorPosition, 0)
William Lancee Well-Known Member Licensed User Longtime User Sep 24, 2021 #3 If you have a multiline view, and you want to move cursor to line i, you have to find the cursor position of the start of line i. Not really a big challenge. Upvote 0
If you have a multiline view, and you want to move cursor to line i, you have to find the cursor position of the start of line i. Not really a big challenge.
T201016 Active Member Licensed User Longtime User Sep 25, 2021 #4 Welcome William, Thank you for the valuable hint, and if you are already in the topic, there is probably a method to obtain programmatic multiline scrolling in edittext, similar to: ScrollY = joEditText.RunMethod ("getScrollY", Null). My idea is to get the effect that I will scroll EditText1 manually, and at the same time have it programmatically scroll itself in another EditText2. Upvote 0
Welcome William, Thank you for the valuable hint, and if you are already in the topic, there is probably a method to obtain programmatic multiline scrolling in edittext, similar to: ScrollY = joEditText.RunMethod ("getScrollY", Null). My idea is to get the effect that I will scroll EditText1 manually, and at the same time have it programmatically scroll itself in another EditText2.