开发者

Changing the zoom out action for a UIWebView

I'm trying to change the way a UIWebView reacts when the user do a pinch out gesture (when he's doing that, I zoom out and show multiple webView).

I see 2 solutions but I can't make them work :

  1. Setting scalesPageToFit to YES, and then getting events that are sent by the API to change the behavior. Problem: I don't find how to catch those events
  2. Setting scalesPageToF开发者_运维知识库it to NO, and adding a PinchGestureRecognizer on the parent of the UIWebView. Problem: The gesture is not well recognize since there are conflicts with the scrolling. If the user starts moving the first finger before putting down the second finger, the scroll begin and the pinchGesture is not recognize.

Do you have an idea ?


Ok, the anwser is just to set the delegate of my UIPinchGestureRecognizer to self and to override

- (BOOL)gestureRecognizer:(UIGestureRecognizer *)recognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer*) otherRecognizer 
{
  return YES;
}

Now the pinch is recognized even if the scroll began in the UIWebView

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜