现在的位置: 首页 > 综合 > 正文

让UILabel提示文字动起来

2017年12月08日 ⁄ 综合 ⁄ 共 295字 ⁄ 字号 评论关闭

当用一个UILabel或者其他作为提示输入错误信息的时候,为了使错误信息引起用户注意,可以采取增加一个动画效果,例如:
        [UIView animateWithDuration:.1 animations:^{
            self.errorLabel.alpha = 0.0;
            
        } completion:^(BOOL finished) {
            
            [UIView animateWithDuration:.1 animations:^{
                self.errorLabel.alpha = 1.0;
                self.errorLabel.text = @"密码或用户名错误,请重试!";
            } completion:^(BOOL finished) {
                
            }];
        }];

抱歉!评论已关闭.