2 developerwab developerWab 于 2013.03.13 16:06 提问

objectiveC中添加多个动画到View中

hi,本人只能添加一个动画到view中,但是需求是添加多个。

请高手帮忙。

谢谢。

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:kAnimationDuration];
//self.square.bounds = CGRectMake(0, 0, self.square.bounds.size.height, 200);
//self.transform = CGAffineTransformMakeScale(2, 1);


CGAffineTransform scaleTrans1 = CGAffineTransformMakeScale(2, 1);

self.transform = scaleTrans1;
[UIView commitAnimations];

1个回答

developerWab
developerWab   2013.03.13 16:52
已采纳

解决了。

- (void)drawRect:(CGRect)rect
{    
    [UIView animateWithDuration:4.0f animations:^{
        self.transform = CGAffineTransformMakeScale(2, 1);
    } completion:^(BOOL finished){
        [UIView animateWithDuration:4.0f animations:^{
           self.transform = CGAffineTransformMakeScale(0.75, 1);
        } completion:^(BOOL finished){
            [UIView animateWithDuration:4.0f animations:^{
              self.transform = CGAffineTransformMakeScale(2, 1);  
            } completion:^(BOOL finished) {
                [UIView animateWithDuration:4.0f animations:^{
                    self.transform = CGAffineTransformMakeScale(0.75, 1);
                }];
            }];
        }];
    }];
}
Csdn user default icon
上传中...
上传图片
插入图片
准确详细的回答,更有利于被提问者采纳,从而获得C币。复制、灌水、广告等回答会被删除,是时候展现真正的技术了!