• <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 中检测滑动手势

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

                  上一篇:在 UIWebView 中自动播放视频 下一篇:使用 UIWebView 搜索以突出显示 PDF 中的文本

                  相关文章

                  <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'>