<legend id='69Jaa'><style id='69Jaa'><dir id='69Jaa'><q id='69Jaa'></q></dir></style></legend>
      <bdo id='69Jaa'></bdo><ul id='69Jaa'></ul>
    <tfoot id='69Jaa'></tfoot>

    1. <small id='69Jaa'></small><noframes id='69Jaa'>

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

      1. iPhone - 自动调整 UIWebView 内容的大小不适合框架

        时间:2023-10-21

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

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

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

                <tbody id='MefZe'></tbody>
                1. 本文介绍了iPhone - 自动调整 UIWebView 内容的大小不适合框架的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 viewDidLoad 方法中生成了一个 UIWebView,它的尺寸很小(比如说 50x70).然后我把它放到一个超级 UIView 中.

                  I'm generating an UIWebView into my viewDidLoad method, with a tiny size (let's say something like 50x70). And then I put it into a super UIView.

                  我想让它的内容适合 webView 框架.为此,我写道:

                  I'd like to make its content fit the webView frame. To do this, I wrote :

                          oneView = [[UIWebView alloc] initWithFrame:CGRectMake(x, y, W, H)];
                          oneView.backgroundColor = [UIColor whiteColor];
                          oneView.autoresizingMask = UIViewAutoresizingFlexibleWidth;
                          oneView.scalesPageToFit = YES;
                          oneView.autoresizesSubviews = YES;
                  
                          [self.view addSubview:oneView];
                          [oneView loadRequest:/*some request*/];
                  

                  但是这样做,网页不会调整到 UIWebView 的框架.它似乎被缩放到其他东西,比 superview 的框架小,比 webview 的宽.

                  But doing this, the web page is not resized to the frame of the UIWebView. It seems to be scaled to something else, smaller than the superview's frame, and wider than the webview's one.

                  如果我将 webview 框架大小设置为整个 superview 的大小,就可以了.
                  我如何强制网页内容(真正的 www 内容)适合缩小的" UIWebView 的框架?

                  If I set the webview frame size to the whole superview's size, it's ok.
                  How may I force the web content (real www content) to fit the frame of the "reduced" UIWebView ?

                  推荐答案

                  答案是:你已经这样做了,但是有限制.

                  The answer is: you are already doing this but there are limits.

                  请看以下截图:

                  截图 1,scalesPageToFit YES 和 NO

                  两个 webview 的宽度相同.在较低的页面中,页面非常适合.

                  Both webview have the same width. In the lower one the page fits perfectly.

                  Screeshot 2,scalesPageToFit 两者都是 YES,但设置的宽度更小

                  两个 webview 都试图适应页面,但由于有大小限制,它不会.

                  Both webview try to fit the page but it won't as there is a size limit.

                  这篇关于iPhone - 自动调整 UIWebView 内容的大小不适合框架的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:UIWebView 中的 MPMoviePlayerController 全屏电影 下一篇:iOS 通过 UIWebView 访问 Safari Reader 功能

                  相关文章

                    <legend id='3Iwdc'><style id='3Iwdc'><dir id='3Iwdc'><q id='3Iwdc'></q></dir></style></legend>
                    • <bdo id='3Iwdc'></bdo><ul id='3Iwdc'></ul>
                  1. <small id='3Iwdc'></small><noframes id='3Iwdc'>

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

                    2. <tfoot id='3Iwdc'></tfoot>