码迷,mamicode.com
首页 > 移动开发 > 详细

code4App-02-伸缩式动画

时间:2015-06-29 11:38:31      阅读:125      评论:0      收藏:0      [点我收藏+]

标签:

 

代码:

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
    
    self.title=@"伸缩式动画";
}

//点击任何处,弹出动画
-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    
    UIView *zanView = [[UIView alloc] initWithFrame:CGRectMake(50, 100, 100, 100)];
    zanView.backgroundColor = [UIColor redColor];
    [self.view addSubview:zanView];
    
    [UIView animateWithDuration:0.3 animations:^{
        zanView.transform = CGAffineTransformMakeScale(1.2, 1.2);
    } completion:^(BOOL finished) {
        [UIView animateWithDuration:0.3 animations:^{
            zanView.transform = CGAffineTransformMakeScale(0.9, 0.9);
        } completion:^(BOOL finished) {
            [UIView animateWithDuration:0.3 animations:^{
                zanView.transform = CGAffineTransformMakeScale(1.0, 1.0);
            } completion:^(BOOL finished) {
                
            }];
        }];
    }];
    
}

 

code4App-02-伸缩式动画

标签:

原文地址:http://www.cnblogs.com/yang-guang-girl/p/4607041.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!