我想将 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){
}];
提前致谢