I have animated images using cakeyframeanimations and used catextlayer animation in synchronise with the image animation. But the problem is the text animation gets synchronised on 1-2 devices and on other animations gets disturbed
Asked
Active
Viewed 36 times
0
-
Can you post some code? – Bas Oct 11 '18 at 09:48
-
CALayer *image1Layer = [CALayer layer]; image1Layer.frame = layer.frame; image1Layer.contentsGravity = kCAGravityResizeAspectFill; image1Layer.position = CGPointMake(CGRectGetMidX(layer.frame), layer.frame.size.height/2); image1Layer.contents = (__bridge id _Nullable)([UIImage imageNamed:baseImageFileName].CGImage);; [layer addSublayer:image1Layer]; – Ruhi Oct 11 '18 at 11:20
-
This is for adding base frame for image animation – Ruhi Oct 11 '18 at 11:22
-
CAKeyframeAnimation *keyframeAnimation = [CAKeyframeAnimation animationWithKeyPath:@"contents"]; keyframeAnimation.values = imageArray; // array with images keyframeAnimation.repeatCount = HUGE; keyframeAnimation.duration = 2.0; keyframeAnimation.removedOnCompletion = YES; [self performSelector:@selector(playSixthAnimation:) withObject:array afterDelay:2]; – Ruhi Oct 11 '18 at 11:23
-
This is for playing image sequence animation using cakeyframeanimation – Ruhi Oct 11 '18 at 11:23
-
// CABasicAnimation * animationTransform = [CABasicAnimation animationWithKeyPath:@"transform"]; // animationTransform.fromValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(0.1, 0.1, 1.0)]; // animationTransform.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.0, 1.0, 1.0)]; // animationTransform.timingFunction = [CAMediaTimingFunction functionWithControlPoints:(0 ):(1.0) :(0.1) :(1)]; – Ruhi Oct 11 '18 at 11:25
-
// [animationTransform setDuration:1]; // animationTransform.repeatCount= 1; // animationTransform.removedOnCompletion=NO; // animationTransform.fillMode=kCAFillModeForwards; // animationTransform.beginTime = CACurrentMediaTime() + 1.5; // [textLayer addAnimation:animationTransform forKey:@"whateveerrTransfomr"]; – Ruhi Oct 11 '18 at 11:25
-
This is for text animation in synchronisation with image animation. – Ruhi Oct 11 '18 at 11:25
-
I have used perform selector to repeat the text animation with the delay of 2 seconds – Ruhi Oct 11 '18 at 11:26
-
The actual problem is that the text animation timing is correct on one device but differs on others – Ruhi Oct 11 '18 at 11:27
-
Please edit your question to include that code, putting it in a bunch of comments is incredibly hard to read. – Bas Oct 11 '18 at 11:35