• <small id='wKhlI'></small><noframes id='wKhlI'>

      <legend id='wKhlI'><style id='wKhlI'><dir id='wKhlI'><q id='wKhlI'></q></dir></style></legend>
      <tfoot id='wKhlI'></tfoot>
      • <bdo id='wKhlI'></bdo><ul id='wKhlI'></ul>
      <i id='wKhlI'><tr id='wKhlI'><dt id='wKhlI'><q id='wKhlI'><span id='wKhlI'><b id='wKhlI'><form id='wKhlI'><ins id='wKhlI'></ins><ul id='wKhlI'></ul><sub id='wKhlI'></sub></form><legend id='wKhlI'></legend><bdo id='wKhlI'><pre id='wKhlI'><center id='wKhlI'></center></pre></bdo></b><th id='wKhlI'></th></span></q></dt></tr></i><div id='wKhlI'><tfoot id='wKhlI'></tfoot><dl id='wKhlI'><fieldset id='wKhlI'></fieldset></dl></div>
      1. 在 UIWebview 中检测滑动手势

        detect Swipe gesture in UIWebview(在 UIWebview 中检测滑动手势)
          <tbody id='qZIgG'></tbody>

        1. <i id='qZIgG'><tr id='qZIgG'><dt id='qZIgG'><q id='qZIgG'><span id='qZIgG'><b id='qZIgG'><form id='qZIgG'><ins id='qZIgG'></ins><ul id='qZIgG'></ul><sub id='qZIgG'></sub></form><legend id='qZIgG'></legend><bdo id='qZIgG'><pre id='qZIgG'><center id='qZIgG'></center></pre></bdo></b><th id='qZIgG'></th></span></q></dt></tr></i><div id='qZIgG'><tfoot id='qZIgG'></tfoot><dl id='qZIgG'><fieldset id='qZIgG'></fieldset></dl></div>

              <tfoot id='qZIgG'></tfoot>
                <bdo id='qZIgG'></bdo><ul id='qZIgG'></ul>

                <small id='qZIgG'></small><noframes id='qZIgG'>

                  <legend id='qZIgG'><style id='qZIgG'><dir id='qZIgG'><q id='qZIgG'></q></dir></style></legend>
                  本文介绍了在 UIWebview 中检测滑动手势的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我是 iPhone 开发者的新手,

                  I am new to iPhone developer,

                  我制作了epub阅读器并在我的webview中加载了epub的每一页

                  I made epub reader and loaded each page of epub in my webview

                  我想要的是,当用户第二次执行 右滑动手势 然后我想导航到新页面,当用户执行 右滑动手势时我不想做任何事情 第一次.

                  What i want to is, when user does right swipe gesture 2nd time then i want to navigate to new page, i do not want to do anything when user does right swipe gesture for first time.

                  UISwipeGestureRecognizer *swipeRight

                  有没有类似的方法,

                  if(swipeRight.touch.count > 2)
                  {
                    // do this
                  }
                  

                  如有任何帮助,我们将不胜感激.

                  提前致谢!

                  编辑

                  -(void)scrollViewDidScroll:(UIScrollView *)scrollView{
                      float scrollViewHeight = scrollView.frame.size.height;
                      float scrollContentSizeHeight = scrollView.contentSize.height;
                      float scrollOffset = scrollView.contentOffset.y;
                  
                      if (scrollOffset == 0)
                      {
                          swipeUp = [[UISwipeGestureRecognizer alloc] initWithTarget:self  action:@selector(swipeLeftAction:)];
                          swipeUp.direction = UISwipeGestureRecognizerDirectionUp;
                          swipeUp.numberOfTouchesRequired=2;
                          swipeUp.delegate = (id<UIGestureRecognizerDelegate>)self;
                          swipeUp.cancelsTouchesInView=YES;
                          [_webview addGestureRecognizer:swipeUp];  
                      }
                      else if (scrollOffset + scrollViewHeight == scrollContentSizeHeight)
                      {
                          swipeDown = [[UISwipeGestureRecognizer alloc] initWithTarget:self  action:@selector(swipeRightAction:)];
                          swipeDown.direction = UISwipeGestureRecognizerDirectionDown;
                          swipeDown.numberOfTouchesRequired=2;
                          swipeDown.delegate = (id<UIGestureRecognizerDelegate>)self;
                          swipeDown.cancelsTouchesInView=YES;
                          [_webview addGestureRecognizer:swipeDown];
                  
                      }
                  

                  推荐答案

                  只需将 UIGestureRecognizer 子类附加到该视图并等待调用...

                  Just attach UIGestureRecognizer subclass to that view and hold on for calls...

                  UISwipeGestureRecognizer* rightSwipeRecognizer = [[UISwipeGestureRecognizer alloc]initWithTarget:self action:@selector(someAction)];
                  rightSwipeRecognizer.numberOfTouchesRequired = 2;
                  rightSwipeRecognizer.direction = UISwipeGestureRecognizerDirectionRight;
                  rightSwipeRecognizer.cancelsTouchesInView = YES;
                  [self.webView addGestureRecognizer:rightSwipeRecognizer]; // add in your webviewrightSwipeRecognizer
                  

                  这篇关于在 UIWebview 中检测滑动手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)
                  [ios.cocos2d+box2d]how to disable auto-rotation?([ios.cocos2d+box2d]如何禁用自动旋转?)
                    <tbody id='JoNav'></tbody>
                    <i id='JoNav'><tr id='JoNav'><dt id='JoNav'><q id='JoNav'><span id='JoNav'><b id='JoNav'><form id='JoNav'><ins id='JoNav'></ins><ul id='JoNav'></ul><sub id='JoNav'></sub></form><legend id='JoNav'></legend><bdo id='JoNav'><pre id='JoNav'><center id='JoNav'></center></pre></bdo></b><th id='JoNav'></th></span></q></dt></tr></i><div id='JoNav'><tfoot id='JoNav'></tfoot><dl id='JoNav'><fieldset id='JoNav'></fieldset></dl></div>

                    1. <legend id='JoNav'><style id='JoNav'><dir id='JoNav'><q id='JoNav'></q></dir></style></legend>
                        <tfoot id='JoNav'></tfoot>

                            <bdo id='JoNav'></bdo><ul id='JoNav'></ul>

                            <small id='JoNav'></small><noframes id='JoNav'>