Hi, I resized the frame using CABasicAnimation i used below code
CABasicAnimation *newanim; newanim = [CABasicAnimation animationWithKeyPath:@"bounds.size"]; newanim.duration=3.0; newanim.fromValue=[NSValue valueWithCGSize:CGSizeMake(0,0)]; newanim.toValue=[NSValue valueWithCGSize:CGSizeMake(self.backgroundImageView.bounds.size.width, self.foregroundImageView.bounds.size.height)]; newanim.fillMode=kCAFillModeForwards; newanim.autoreverses = YES; newanim.repeatCount = 1; newanim.timingFunction = [CAMediaTimingFunction functionWithName: kCAMediaTimingFunctionEaseInEaseOut]; [self.view.layer addAnimation:newanim forKey:@"changeSize"];
But the animation starts from the origin and moves on both sides (for example, the animation starts from the center).
I tried changing newanim = [CABasicAnimation animationWithKeyPath: @ "frame.size"];
it doesn't work at all.
jeeva
source share