Android Edit Text - Cursor stays at the starting position

前端 未结 5 1197
野趣味
野趣味 2021-01-19 03:03

I am using an Edit Text in my project.

The problem is that whenever I type anything into the text box, it shows up, but the cursor does not move from its starting po

5条回答
  •  猫巷女王i
    2021-01-19 03:15

    set these properties to your XML file

      
    
       
    
    
    

    Try this. and put this in your java code.

     EditText et = (EditText)findViewById(R.id.xEt);
     et.setSelection(et.getText().length());
    

提交回复
热议问题