I think I found an error in UIScrollView, but I want to check if other people are observing the same thing and if this is the expected behavior.
I have a UIScrollView and am trying to set what it is looking at using zoomToRect. It works great. If I then dragged the view so that it looks elsewhere and then ran zoomToRect with the same values, it does nothing. The zoomToRect command does something only if the scaling needs to be adjusted, if the pan is all that is needed, the view just sits motionless. Since the user could pinch to zoom in or out, I was just hoping to use zoomToRect, and you don't need to double-check that the ZoomLevels will be different.
Has anyone else experienced this? If this happens like this or is it a mistake?
*** Adding code as requested
First call to zoomToRect
[myScrollView zoomToRect:zoomToRect animated:YES]
Correctly look at the point in the UIScrollView that I wanted it to be
Now let the user drag and drop the screen that the UIScrollView is looking at. No scaling, only panning.
Now call zoomToRect again, with the same direct
[myScrollView zoomToRect:zoomToRect animated:YES]
Nothing happens.
source share