Setting cursor to the right for each edittext on a listview is inconsistent

Hi, I have been struggling with the following issues for a few days now.

I have a ListView of EditTexts that can only contains numeric values. Whenever I tap on an editText to change the value, the cursor tends to appear on left side. After doing some research on how to set the cursor on the right, the best solution was using the following:
edittext.SetSelection(edittext.text.length);

I have implemented this solution as follow in the GetBindableView of my MvxAdapter

edittext.FocusChange += (sender, e) =>
{
                var obj = sender as EditText;

                if (obj.HasFocus)
                {
                    var position = obj.Text.Length;
                    obj.SetSelection(position);
                }
 };

The method gets executed, however, it only works for the first edittext that receives focus. When I tap on another edittext on the listview, the cursor does not jump to the right as expected.

One other thing I have noticed is after dismissing the soft keyboard, then selecting another edittext, the cursor gets positioned to the right as expected.

Has anyone encountered such behaviour? Some solution or guidance would be appreciated.

Sign In or Register to comment.