VerificationCodeView
VerificationCodeView copied to clipboard
清空输入内容会出现输入框背景乱

可以改下VerificationCodeView这个类里的删除监听方法:

可以改成这样
/** * 监听删除 */ private void onKeyDelete() { for (int i = mPwdTextViews.length - 1; i >= 0; i--) { PwdTextView tv = mPwdTextViews[i]; if (!tv.getText().toString().trim().equals("")) { if (mEtPwd) { tv.clearPwd(); } tv.setText(""); // 添加删除完成监听 tv.setBackgroundDrawable(mEtBackgroundDrawableNormal); if (i == 0) { mPwdTextViews[0].setBackgroundDrawable(mEtBackgroundDrawableFocus); } else { if (i < mEtNumber) { mPwdTextViews[i - 1].setBackgroundDrawable(mEtBackgroundDrawableFocus); } } // 添加输入完成的监听 if (inputCompleteListener != null) { inputCompleteListener.inputComplete(); } break; } } }