时间:2021-08-22 09:48:30 | 栏目:iOS代码 | 点击:次
例如,在发送验证码后,button状态需要变为disable,每隔一秒显示倒计时时间,仅仅设置
[button setTitle:title forState:UIControlStateDisabled];
或
[button setTitle:title forState:UIControlStateNormal];
是不够的,按钮会一闪一闪的抖动。
需要同时设置:
button.titleLabel.text = title; [button setTitle:title forState:UIControlStateDisabled];
或
button.titleLabel.text = title; [button setTitle:title forState:UIControlStateNormal];