获取短信验证码之后按钮背景变化并且出现倒计时
发布时间:2016-01-08 16:00:08
private Button getVerCodeButton;//初始化getVerCodeButton = (Button) findViewById(R.id.login_get_ver_code);/** * 显示时间在梯减的文本框 */ public void ...
private Button getVerCodeButton;//初始化getVerCodeButton = (Button) findViewById(R.id.login_get_ver_code);/** * 显示时间在梯减的文本框 */ public void showTime() { new Thread(new Runnable() { boolean result = true; int time = 30; @Override public void run() { while (result) { time--; SystemClock.sleep(1000); getVerCodeButton.post(new Runnable() { @Override public void run() { getVerCodeButton.setTextSize(11); getVerCodeButton.setText(time + "秒后重新获取"); getVerCodeButton.setClickable(false); getVerCodeButton.setBackgroundResource(R.drawable.login_get_ver_code_ago_bg); } }); if (time <= 1) { result = false; getVerCodeButton.post(new Runnable() { @Override public void run() { getVerCodeButton.setTextSize(10); getVerCodeButton.setText("重新获取验证码"); getVerCodeButton.setClickable(true); getVerCodeButton.setBackgroundResource(R.drawable.login_get_ver_code_before_bg); } }); } } } }).start(); }
原标题:获取短信验证码之后按钮背景变化并且出现倒计时
关键词:
*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们:
admin#shaoqun.com
(#换成@)。
美国贸易战略:https://www.goluckyvip.com/tag/12565.html
人民日报头版:https://www.goluckyvip.com/tag/12566.html
跨境电试验区:https://www.goluckyvip.com/tag/12567.html
视频编辑软件:https://www.goluckyvip.com/tag/12568.html
航班影响:https://www.goluckyvip.com/tag/1257.html
全球物流排行:https://www.goluckyvip.com/tag/12570.html
成都极地海洋公园攻略玩哪些项目最划算?:https://www.vstour.cn/a/365173.html
深圳玉龙公园簕杜鹃花海花期时间+门票+交通:https://www.vstour.cn/a/365174.html