Scrolling in pan mode prevents stiffness?

I am creating an image tile library for use in a game project to fit into our existing structure. I am currently using UIScrollView (with an empty view) to allow me to capture beautiful physics for panning with a failure, but I had to implement my own scale with a gesture recognizer (for reasons I won't go into).

Here, however, when I fend off with one finger, adding a second touch and trying to zoom in, does nothing. I need to be absolutely still until this allows me to zoom in. When the user pans around the image, my gesture recognizer does not work unless the pan is completely finished.

Does anyone know about this that is not related to the failure of UIScrollView and the implementation of my own brass knuckles?

Here is my scrollViewDidScroll function:

- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    viewingBounds.origin.x = scrollView.contentOffset.x;
    // Transform the y from UIKit coordinates into OpenGL coordinates
    viewingBounds.origin.y = world.height - viewingBounds.size.height - scrollView.contentOffset.y;
    [parentScene update]; // Render the image
}

My gesture recognizer is added directly to the scroll view in init:

[scrollView addGestureRecognizer:[[[UIPinchGestureRecognizer alloc] initWithTarget:self action:@selector(didReceivePinch:)] autorelease]];
+3
source share
3 answers

You need to set the delegate of the GestureRecognizer objects, and in deletet implement this method:

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer;

And return YES.

+1
source

Have you tried anything from Apple ZoomingPDFViewer or PhotoScroller ? In Photo Scroller, images are tiled and tiled, and you zoom in. Hope you can get out of it. If you have problems unpacking the file, try downloading it from Xcode.

, , - :

https://stackoverflow.com/questions/5383757/scaling-panning-a-uiimageview-using-pinch-and-swipe-gestures-free-code

http://answers.unity3d.com/questions/22500/how-to-zoom-and-pan-when-you-pinchswipe-across-scr.html

http://technology.blurst.com/iphone-multi-touch/

, .

0

, , , - , , , , - , , .

0

All Articles