0

我想将 CABasicAnimation 转换为 UIView animatewithDuration ,如果有可能这样做?

到目前为止,这是我尝试过的代码

CABasicAnimation *myAni = [CABasicAnimation animationWithKeyPath:@"transform.scale.x"];
myAni.duration = 2.0f;
myAni.fromValue = [NSNumber numberWithFloat:1.0];
myAni.toValue = [NSNumber numberWithFloat:2.0];

[self.myView addAnimation:scaleAnimation forKey:@"myKey"];

要在[UIView animateWithDuration...。(而不是CABasicAnimation,我希望它在animationWithDuration块中animations。)

这可能吗?如果是这样,怎么做?

[UIView animateWithDuration:0.5
                      delay:1.0
                    options: UIViewAnimationCurveEaseOut
                 animations:^{
                     //I need it here
                 } 
                 completion:^(BOOL finished){

                 }];

提前致谢

4

1 回答 1

0
  [UIView animateWithDuration:0.5
                          delay:1.0
                        options: UIViewAnimationOptionCurveEaseInOut
                     animations:^{
                         //self.myView.transform = CGAffineTransformMakeScale(2.0,1.0);
                     self.testview.layer.transform = CATransform3DMakeScale(2.0,1.0,1.0);

                     }
                     completion:^(BOOL finished){

                     }];
于 2015-05-06T04:46:06.363 回答