Programmatically zoom in and out on the iPhone: how can I adjust the animation speed?

I have an application in which I would like to dynamically enlarge and reduce the image.

I use [scrollView zoomToRect:CGRectMake(x,y,z,k) animated:YES]; to increase, but I would like the animation to be slower ... is there a way to set the animation speed?

+6
source share
1 answer

see my other answer . You can set the animation duration to approximately 1.0 second.

instead:
cursorView.center = locationOfTouch;

you need to install:

 [UIView beginAnimations:nil context:NULL] [UIView setAnimationDuration:1.0]; [UIView setAnimationBeginsFromCurrentState:YES]; [UIView setAnimationCurve:UIViewAnimationCurveLinear]; [scrollView zoomToRect:CGRectMake(x,y,z,k) animated:NO]; // NO is necessary! [UIView commitAnimations]; 
+7
source

Source: https://habr.com/ru/post/915135/


All Articles