• <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 中检测滑动手势的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  iOS UIWebView app opens link in Safari(iOS UIWebView 应用在 Safari 中打开链接)
                  Close UIWebView using javascript:window.close();(使用 javascript:window.close() 关闭 UIWebView;)
                  NSCachedURLResponse returns object, but UIWebView does not interprets content(NSCachedURLResponse 返回对象,但 UIWebView 不解释内容)
                  Trouble hiding iAd banner and displaying UIWebView in its place(无法隐藏 iAd 横幅并在其位置显示 UIWebView)
                  Knowing when AJAX has loaded in UIWebView(知道何时在 UIWebView 中加载了 AJAX)
                  Load image/logo in existing HTML input field - UIWebView(在现有的 HTML 输入字段中加载图像/徽标 - UIWebView)
                    <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'>