EditText焦点状态监听事件

有时候我们需要监听EditText的焦点状态,可以调用下面的方法处理事件:

holder.etNum.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                if(hasFocus){
                    checkFocusInterface.editTextHasFocus(position,v,hasFocus);
                }
            }
        });

猜你喜欢

转载自blog.csdn.net/qq_36428821/article/details/77067461