UIView animation change of angle is not smooth, it leads to elasticity effect

I am trying to animate a UIView frame change, where both the start and the size change. The animation does not look smooth and has an invigorating effect. I am using the following code for this

[UIView animateWithDuration:0.5 animations:^{ self.view.frame = newFrame; }]; 

It seems that the size first changes very quickly, and then the origin changes with the specified duration of the animation, which ultimately leads to an elastic effect. How to make it smooth?

+8
ios animation uiview frame
source share
2 answers

During the animation of changing the frame of each of the subzones, magic was individually performed. Now it comes to life very smoothly. Thanks.

+3
source share

You can try changing the animation curve, maybe try a 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]; }); 
+12
source share

All Articles