EDITTEXT跳到旁边的EditText达到最大长度的Edit

EDITTEXT跳到旁边的EditText达到最大长度的Edit

本文介绍了EDITTEXT跳到旁边的EditText达到最大长度的EditText后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的布局,我有4个EditText上..我需要达到的最大长度后,跳转到下一个的EditText。但是有一个problem..How办呢?。请人帮我做这件事......

In my layout I have 4 edittext.. I need to jump to the next edittext after reaching the maximum length . But there is a problem..How to do it?.. Please anybody help me to do this...

推荐答案

在reachin更改的EditText的焦点到下一个计数

On reachin the count you change the focus of the edittext to the next one

Edittext edt1;
Edittext edt2:
//mount the views to java from xml
edt1.addTextChangedListener(this);
@Override
public void afterTextChanged(Editable s) {
    // TODO Auto-generated method stub

}
@Override
public void beforeTextChanged(CharSequence s, int start, int count,
        int after) {
    // TODO Auto-generated method stub


}
@Override
public void onTextChanged(CharSequence s, int start, int before, int count) {
    // TODO Auto-generated method stub
if(count==length){
edt2.requestFocus()
}
}

这篇关于EDITTEXT跳到旁边的EditText达到最大长度的EditText后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-30 06:20