I am trying to animate the frame change of an UIView where both the origin and the size changes. The animation doesn't look smooth and has got a bouncy effect. I am using the following code to do that
[UIView
animateWithDuration:0.5
animations:^{
self.view.frame = newFrame;
}];
It seems that the size first changes very fast and then the origin changes with the specified duration of the animation which finally results in a bouncy effect. How do I make this look smooth?
You could try to change the animation curve, maybe try the linear one.
dispatch_async(dispatch_get_main_queue(), ^{
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.5];
[UIView setAnimationCurve:UIViewAnimationCurveLinear];
self.view.frame = newFrame;
[UIView commitAnimations];
});
On animating the frame change of each of the subviews individually did the magic. Now it animates very smoothly. Thanks.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With