• <bdo id='Tz1Cs'></bdo><ul id='Tz1Cs'></ul>

    <legend id='Tz1Cs'><style id='Tz1Cs'><dir id='Tz1Cs'><q id='Tz1Cs'></q></dir></style></legend>

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

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

    2. <small id='Tz1Cs'></small><noframes id='Tz1Cs'>

        允许在 UIWebView 上禁用滚动?

        时间:2023-10-22
        <legend id='4PSl3'><style id='4PSl3'><dir id='4PSl3'><q id='4PSl3'></q></dir></style></legend>

            <tfoot id='4PSl3'></tfoot>

              <tbody id='4PSl3'></tbody>

            <small id='4PSl3'></small><noframes id='4PSl3'>

              1. <i id='4PSl3'><tr id='4PSl3'><dt id='4PSl3'><q id='4PSl3'><span id='4PSl3'><b id='4PSl3'><form id='4PSl3'><ins id='4PSl3'></ins><ul id='4PSl3'></ul><sub id='4PSl3'></sub></form><legend id='4PSl3'></legend><bdo id='4PSl3'><pre id='4PSl3'><center id='4PSl3'></center></pre></bdo></b><th id='4PSl3'></th></span></q></dt></tr></i><div id='4PSl3'><tfoot id='4PSl3'></tfoot><dl id='4PSl3'><fieldset id='4PSl3'></fieldset></dl></div>
                  <bdo id='4PSl3'></bdo><ul id='4PSl3'></ul>
                  本文介绍了允许在 UIWebView 上禁用滚动?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我必须在文章下方显示带有 UITableView 的网络文章.

                  I have to show a web article with a UITableView under the article.

                  我发现的唯一选择是在 tableView 标题中的 UIWebView 中显示文章.

                  The only option I found was to display the article in a UIWebView in the tableView header.

                  为此,我必须获取 webView 内容的高度,并且必须禁用 webView 的滚动.

                  In order to do that I have to get the height of the webView content and I have to disable scrolling for the webView.

                  我找到了两种禁用滚动的解决方案:

                  I found two solutions to disable scrolling:

                  for (id subview in webView.subviews)
                      if ([[subview class] isSubclassOfClass: [UIScrollView class]])
                          ((UIScrollView *)subview).scrollEnabled=NO;
                  

                  或在 JavaScript 中:

                  or in JavaScript:

                  <script type="text/javascript">
                  touchMove = function(event) {
                      event.preventDefault();
                  }
                  

                  我听说第一个解决方案被 Apple 禁止,但我没有任何证据.使用此解决方案会拒绝我的申请吗?如果是这样,我可以使用第二种解决方案而不会被拒绝吗?

                  I heard that the first solution is forbidden by Apple but I don't have any proof of it. Will my application be rejected by using this solution? If so, can I use the second solution without being rejected?

                  推荐答案

                  从 iOS5 开始我们可以直接访问 UIWebView 的滚动视图.
                  您可以像这样禁用滚动和反弹:

                  Starting with iOS5 we have direct access to the scrollview of the UIWebView.
                  You can disable scrolling and bounces like this:

                  webView.scrollView.scrollEnabled = NO; 
                  webView.scrollView.bounces = NO;
                  

                  这篇关于允许在 UIWebView 上禁用滚动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:在 iphone 的 UIWebView 中显示自定义菜单 下一篇:UITableViewCell 与 UIWebView 动态高度

                  相关文章

                        <bdo id='KhyUi'></bdo><ul id='KhyUi'></ul>
                    1. <small id='KhyUi'></small><noframes id='KhyUi'>

                      <tfoot id='KhyUi'></tfoot>

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

                      <legend id='KhyUi'><style id='KhyUi'><dir id='KhyUi'><q id='KhyUi'></q></dir></style></legend>