CAReplicatorLayer * repLlayer = [CAReplicatorLayer layer];//复制层layer
repLlayer.frame = _LoadView.bounds;
repLlayer.backgroundColor = [UIColor blackColor].CGColor;
[_LoadView.layer addSublayer:repLlayer];
CALayer * layer = [CALayer layer];
layer.frame = CGRectMake(0, 0, 10, 10);
layer.transform = CATransform3DMakeScale(0, 0, 0);
layer.anchorPoint = CGPointMake(0.5, 1);
layer.position = CGPointMake(_LoadView.frame.size.width/2, 10);
layer.cornerRadius = 5 ;
layer.backgroundColor = [UIColor greenColor].CGColor;
[repLlayer addSublayer:layer];
repLlayer.instanceCount = 20 ;
repLlayer.instanceDelay = 2.0/20;
// repLlayer.repeatDuration = 2.0/20;
repLlayer.instanceTransform = CATransform3DMakeRotation(M_PI *2/20, 0, 0, 1);
CABasicAnimation * baseAni = [[CABasicAnimation alloc]init];
baseAni.keyPath = @"transform.scale";
baseAni.fromValue = @1;
baseAni.toValue = @0;
baseAni.duration = 2;
baseAni.repeatCount = MAXFLOAT ;
[layer addAnimation:baseAni forKey:nil];
网友评论