[英]Observe progress of UIView.animateWithDuration/CABasicAnimation?
[英]How to convert a CABasicAnimation to UIView animatewithDuration
我想將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){
}];
提前致謝
[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){
}];
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.