• <bdo id='ydZJx'></bdo><ul id='ydZJx'></ul>
  • <legend id='ydZJx'><style id='ydZJx'><dir id='ydZJx'><q id='ydZJx'></q></dir></style></legend>

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

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

      1. <tfoot id='ydZJx'></tfoot>

        检测我何时在页面顶部滚动 UIWebView

        时间:2023-11-09
        <legend id='XUqn4'><style id='XUqn4'><dir id='XUqn4'><q id='XUqn4'></q></dir></style></legend>
            <tbody id='XUqn4'></tbody>
          <i id='XUqn4'><tr id='XUqn4'><dt id='XUqn4'><q id='XUqn4'><span id='XUqn4'><b id='XUqn4'><form id='XUqn4'><ins id='XUqn4'></ins><ul id='XUqn4'></ul><sub id='XUqn4'></sub></form><legend id='XUqn4'></legend><bdo id='XUqn4'><pre id='XUqn4'><center id='XUqn4'></center></pre></bdo></b><th id='XUqn4'></th></span></q></dt></tr></i><div id='XUqn4'><tfoot id='XUqn4'></tfoot><dl id='XUqn4'><fieldset id='XUqn4'></fieldset></dl></div>

        1. <small id='XUqn4'></small><noframes id='XUqn4'>

        2. <tfoot id='XUqn4'></tfoot>

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

                • 本文介绍了检测我何时在页面顶部滚动 UIWebView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想在我的 webview 顶部添加一个 URL/google 栏,并像 Safari 一样通过向上滚动我的网页来访问它.为此,我会检测用户何时滚动页面,以及何时滚动到达顶部.

                  I would like to add an URL/google bar on top of my webview, and access it by scrolling up my web page exactly as Safari do. To do this, I would detect when the user is scrolling the page, and more over when the scroll reaches the top.

                  但我真的不知道怎么做.

                  But I really don't know how.

                  一个想法?非常感谢.

                  马丁

                  推荐答案

                  我也在挖掘同样的问题并找到了解决方案.我编写了以下方法来检测滚动坐标.见下文:

                  I was also digging for the same and found a solution. I coded the following method to detect the scrolling coordinates. See below:

                  -(void)userDidScrollWebView:(id)scrollPoint{
                      // NSLog(@"scrolled:::");
                  
                      NSString *x1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollX"];
                  
                  
                      NSString *y1 = [webView stringByEvaluatingJavaScriptFromString: @"scrollY"];
                  
                  
                      NSLog(@"scroll x=%@ y=%@", x1,y1);      
                  
                      if ([y1 isEqualToString: @"0"]) {
                          NSLog(@"RELAOD ME");
                      }   
                  }
                  

                  希望对您有所帮助.

                  这篇关于检测我何时在页面顶部滚动 UIWebView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何在 UIWebView 中设置自定义字体? 下一篇:如何从 UIWebView 获取 URL 的哈希片段

                  相关文章

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

                  <small id='72kE1'></small><noframes id='72kE1'>

                    <legend id='72kE1'><style id='72kE1'><dir id='72kE1'><q id='72kE1'></q></dir></style></legend>
                    • <bdo id='72kE1'></bdo><ul id='72kE1'></ul>

                    <tfoot id='72kE1'></tfoot>