短信验证码 UI
来源:互联网 发布:个人域名 gmail 编辑:程序博客网 时间:2024/04/24 21:32
//获取验证码 UIButton* forgetCodeButton = [[UIButton alloc]init]; [forgetCodeButton setTitle:@"获取验证码" forState:UIControlStateNormal]; //右对齐 [forgetCodeButton setContentHorizontalAlignment:UIControlContentHorizontalAlignmentCenter]; forgetCodeButton.titleLabel.font=[UIFont systemFontOfSize:12]; [forgetCodeButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal]; forgetCodeButton.frame = CGRectMake(CGRectGetMaxX(_passwordTextField.frame), CGRectGetMinY(_passwordTextField.frame), 79, 29); forgetCodeButton.backgroundColor = NavThemeColor; forgetCodeButton.layer.cornerRadius = 5; forgetCodeButton.layer.masksToBounds = YES; [forgetCodeButton addTarget:self action:@selector(didClickForgetCodeButton) forControlEvents:UIControlEventTouchUpInside]; [scrollView addSubview:forgetCodeButton]; _forgetCodeBtn = forgetCodeButton; [self forgetCodeBtnNotClick]; _forgetCodeBtnNum = 0;
//获取验证码点击- (void)didClickForgetCodeButton{ [self forgetCodeBtnNotClick]; [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timeWithTimer:) userInfo:nil repeats:YES]; _forgetCodeBtnNum = 59; [_forgetCodeBtn setTitle:[NSString stringWithFormat:@"60秒再次获取"] forState:UIControlStateNormal]; [self callForgetCode];}
- (void)timeWithTimer:(NSTimer *)timer{ if (_forgetCodeBtnNum>0) { [_forgetCodeBtn setTitle:[NSString stringWithFormat:@"%ld秒再次获取",(long)_forgetCodeBtnNum] forState:UIControlStateNormal]; }else{ [_forgetCodeBtn setTitle:[NSString stringWithFormat:@"获取验证码"] forState:UIControlStateNormal]; [self forgetCodeBtnClickable]; [timer invalidate]; } _forgetCodeBtnNum--;}
- (void)forgetCodeBtnClickable{ _forgetCodeBtn.userInteractionEnabled = YES; _forgetCodeBtn.backgroundColor = RGB_COLOR(80, 210, 194);}
- (void)forgetCodeBtnNotClick{ _forgetCodeBtn.userInteractionEnabled = NO; _forgetCodeBtn.backgroundColor = RGB_COLOR(204, 211, 213);}
阅读全文
0 0
- 短信验证码 UI
- vue 短信验证码UI
- 使用自定义ui的ShareSDK短信验证码功能
- 手机获取短信验证码——内置UI界面
- 手机获取短信验证码——自定义UI界面
- 手机验证码短信
- 短信验证码倒计时
- 短信验证码
- 实现短信验证码
- 短信验证码
- iOS 短信验证码
- VertificationCode---短信验证码
- 发送短信验证码
- sharesdk 短信验证码
- 产生短信验证码
- 短信验证码
- 短信验证码相关
- 短信验证码服务
- 处理$.ajax传递json格式参数,属性为null,undefined,“”
- 安卓源码集合
- HBase
- github使用发现优秀的开源项目
- 感冒
- 短信验证码 UI
- iptables 从放弃 到 熟悉
- QT5中的pro文件中为何要加入”QT += widgets”
- Windows Thread.sleep(0)的意义
- android插件化学习
- 悦读---《万万没想到-用理工科思维理解世界》(1)
- 1208:鸡兔同笼
- 计算机本科生不甘现状,在传智播客上海校区学有所成
- Linux基础练习三