liuguangli / VerificationCodeInput

简洁验证码输入框,能自定义输入框个数和样式

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

支不支持清空录入框内容呢?

benngai123 opened this issue · comments

好像没有看到clear()之类的方法

for (int i=0;i<verificationCodeInput.getChildCount();i++){//遍历子类
verificationCodeInput.getChildAt(i).setEnabled(true);//设置可点击
EditText childAt = (EditText) verificationCodeInput.getChildAt(i);
childAt.setText("");//清空内容
if(i==0){//第一个获取焦点
verificationCodeInput.getChildAt(i).requestFocus();
verificationCodeInput.getChildAt(i).setFocusable(true);
verificationCodeInput.getChildAt(i).setFocusableInTouchMode(true);
}
}