gpt4 book ai didi

ios - CABasicAnimation中progress keypath的含义是什么?

转载 作者:行者123 更新时间:2023-12-01 19:59:26 25 4
gpt4 key购买 nike

来自 https://github.com/danielamitay/DACircularProgress/blob/master/DACircularProgress/DACircularProgressView.m 的代码片段

CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"progress"];
animation.duration = duration;
animation.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut];
animation.fillMode = kCAFillModeForwards;
animation.fromValue = [NSNumber numberWithFloat:self.progress];
animation.toValue = [NSNumber numberWithFloat:pinnedProgress];
animation.beginTime = CACurrentMediaTime() + initialDelay;
animation.delegate = self;
[self.circularProgressLayer addAnimation:animation forKey:@"progress"];

但是我找不到 progressoffical document .键路径是否需要是可动画的属性? progress 是什么意思意思是?

最佳答案

来自 this answer (巧合的是 progress 的动画):

Firstly we need to create a new subclass of CALayer that has an animatable property called 'progress'.



您的代码段确实有一个名为“进度”的属性
@property(nonatomic) CGFloat progress;

看来动画正在为该属性设置动画

关于ios - CABasicAnimation中progress keypath的含义是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40653021/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com