Blinking effect on UILabel

前端 未结 14 2002
野的像风
野的像风 2020-12-13 14:24

I have a UILabel with background color as grey.

I want a blinking effect on this label like it should become a little white & then become gray and it should keep

14条回答
  •  孤街浪徒
    2020-12-13 15:06

    You can do this within a block:

    self.yourLabel.alpha = 1;
    [UIView animateWithDuration:1.5 delay:0.5 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionAutoreverse animations:^{
            self.yourLabel.alpha = 0;
    } completion:nil];
    

    So you dont need a second method.

提交回复
热议问题