首页 > 移动平台 > 详细

第13月第13天 iOS 放大消失动画

时间:2017-10-13 11:04:50      阅读:231      评论:0      收藏:0      [点我收藏+]

1.

- (void) animate
{
    [UIView animateWithDuration:0.9 animations:^{
    
        CGAffineTransform transform = CGAffineTransformMakeScale(2.5, 2.5);
        self.countdownLabel.transform = transform;
        self.countdownLabel.alpha = 0;
        
    } completion:^(BOOL finished) {
        if (finished) {
            
             if (self.currentCountdownValue == 0) {
                 [self stop];
                 if (self.delegate) {
                     [self.delegate countdownFinished:self];
                     [self removeFromSuperview];
                 }
                 
             } else {

                self.countdownLabel.transform = CGAffineTransformIdentity;
                self.countdownLabel.alpha = 1.0;
                
                self.currentCountdownValue--;
                if (self.currentCountdownValue == 0) {
                    self.countdownLabel.text = self.finishText;
                } else {
                    self.countdownLabel.text = [NSString stringWithFormat:@"%d", self.currentCountdownValue ];
                }
            }
        }
    }];
}

 

https://github.com/simpliflow/SFCountdownView

 

第13月第13天 iOS 放大消失动画

原文:http://www.cnblogs.com/javastart/p/7660054.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!