iOS 控件闪动动画

- (void)viewWillAppear:(BOOL)animated

{

    [superviewWillAppear:animated];

    for(inti =0; i <3; i ++) {

        UIButton*tagBtn = [self.viewviewWithTag:100+i];

        [selfaddScaleAnimationTo:tagBtn];

    }

}



- (void)addScaleAnimationTo:(UIView*)animationView

{

    [animationView.layer removeAnimationForKey:@"scale"];

    CABasicAnimation *scaleAnimation = [CABasicAnimation animationWithKeyPath:@"transform.scale"];

    [email protected];

    [email protected];

    scaleAnimation.autoreverses=YES;

    scaleAnimation.repeatCount=HUGE_VALF;

    scaleAnimation.duration=2.f;

    [animationView.layeraddAnimation:scaleAnimationforKey:@"scale"];

}

你可能感兴趣的:(iOS 控件闪动动画)