How to change the focus to next edit text in android?(如何将焦点更改为android中的下一个编辑文本?)
问题描述
用户只能在编辑文本中输入一位数字.如果他在 edtText1 中输入值,我希望光标自动移动到 edtText2 等等.用户可以编辑他/她已经输入的文本.我尝试了以下方式.
The User can enter only one digit in the edit text. if he enters the value in edtText1, I want the cursor automatically moves to edtText2 and so on. The user can able to edit the text which he/she has entered already. I tried the following way.
如果用户编辑文本,光标会移动到其他一些editTexts并且无法按预期工作.我怎样才能实现上述目标?
If the user edit the text, The cursor moves to some other editTexts and not working as desired. How can i achieve the above?
推荐答案
试试 TextWatcher 代替 onKeyListener
如果你想修改你的密码,那么TextWatcher会给你更多的处理方法..
B'coz if want to edit your password, in that case TextWatcher will give you more method to dealt with..
已-
希望这项工作.
这篇关于如何将焦点更改为android中的下一个编辑文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!