当CAReplicatorLayer的速度等于0时,复制效果消失

时间:2019-01-17 06:58:23

标签: objective-c

CAReplicatorLayer *replicatorLayer = [CAReplicatorLayer layer];
replicatorLayer.speed = 0.0;
replicatorLayer.frame = CGRectMake(originX, originY, self.size, self.size);

CATransform3D transform = CATransform3DMakeTranslation(circleSize + circlePadding, 0, 0);
replicatorLayer.instanceTransform = transform;
replicatorLayer.instanceCount = count;
replicatorLayer.instanceDelay = animationDuration / (count*2);

CALayer *layer = [CALayer layer];
layer.frame = CGRectMake(0, self.size*0.5 - circleSize*0.5, circleSize, circleSize);
layer.backgroundColor = [UIColor redColor].CGColor;
layer.cornerRadius = circleSize / 2;
layer.masksToBounds = YES;
layer.backgroundColor = self.tintColor.CGColor;
[replicatorLayer addSublayer:layer];

当设置speed = 0.0时,不会复制子层。我想在CAReplicatorLayer的子层上暂停动画。

0 个答案:

没有答案