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

      <tfoot id='aEPPK'></tfoot>
      <legend id='aEPPK'><style id='aEPPK'><dir id='aEPPK'><q id='aEPPK'></q></dir></style></legend>
    1. <i id='aEPPK'><tr id='aEPPK'><dt id='aEPPK'><q id='aEPPK'><span id='aEPPK'><b id='aEPPK'><form id='aEPPK'><ins id='aEPPK'></ins><ul id='aEPPK'></ul><sub id='aEPPK'></sub></form><legend id='aEPPK'></legend><bdo id='aEPPK'><pre id='aEPPK'><center id='aEPPK'></center></pre></bdo></b><th id='aEPPK'></th></span></q></dt></tr></i><div id='aEPPK'><tfoot id='aEPPK'></tfoot><dl id='aEPPK'><fieldset id='aEPPK'></fieldset></dl></div>
    2. <small id='aEPPK'></small><noframes id='aEPPK'>

    3. UIWebView 内容不能在不同 iPhone 尺寸之间缩放

      UIWebView content not scaling between different iPhone sizes(UIWebView 内容不能在不同 iPhone 尺寸之间缩放)
          <tbody id='GDm3l'></tbody>
        • <i id='GDm3l'><tr id='GDm3l'><dt id='GDm3l'><q id='GDm3l'><span id='GDm3l'><b id='GDm3l'><form id='GDm3l'><ins id='GDm3l'></ins><ul id='GDm3l'></ul><sub id='GDm3l'></sub></form><legend id='GDm3l'></legend><bdo id='GDm3l'><pre id='GDm3l'><center id='GDm3l'></center></pre></bdo></b><th id='GDm3l'></th></span></q></dt></tr></i><div id='GDm3l'><tfoot id='GDm3l'></tfoot><dl id='GDm3l'><fieldset id='GDm3l'></fieldset></dl></div>
          <tfoot id='GDm3l'></tfoot>

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

          1. <legend id='GDm3l'><style id='GDm3l'><dir id='GDm3l'><q id='GDm3l'></q></dir></style></legend>
            • <bdo id='GDm3l'></bdo><ul id='GDm3l'></ul>

                本文介绍了UIWebView 内容不能在不同 iPhone 尺寸之间缩放的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                所以我正在开发一个使用 UIWebView 来提供 HTML 内容的 iOS 应用程序.为什么是 UIWebView 而不是 WKWebView?好吧,我希望这个应用程序可以在 iOS7 及更高版本上运行.我刚刚将我的 Xcode 更新为 Xcode 6.1,当从 4 英寸屏幕尺寸更改为 4.7 及以上时,我无法让我的 webView 缩放以适应可用的屏幕空间.

                So I am working on an iOS app that uses the UIWebView to serve HTML content. Why UIWebView and not WKWebView? well I want this app to work on iOS7 and above. I have just updated my Xcode to Xcode 6.1 and I cannot get my webView to scale to fit the available screen space when changing from the 4 inch screen size to 4.7 and above.

                我所追求的是让我的应用程序在所有 4 英寸及以上的 iPhone 屏幕尺寸上看起来一致,就像我在 Web 视图上显示的所有 HTML5 代码一样.

                What I am after is to have my app look consistent on all iPhone screen sizes of 4 inch and above as all my HTML5 code that is displayed on the web view is.

                在我的属性检查器中,我已将尺寸设置为 iPhone 4 英寸,您可以在下面的链接中分别看到该应用在 4 英寸和 4.7 英寸 iPhone 模拟器中的外观,http://imgur.com/gallery/tz7LG/new

                In my Attributes inspector I have set the size to iPhone 4-inch and you can see what the app looks like in simulators for iPhones of size 4-inch and 4.7-inch respectively in the link below, http://imgur.com/gallery/tz7LG/new

                如何让它在不同尺寸的 iPhone 屏幕上适当放大?

                How do I get this to scale up appropriately on iPhone screens of different sizes?

                fyi,我已将我的 webView 的缩放"页面设置为适合".我正在使用 Swift 构建这个应用程序.

                fyi, I have set the Scale page to Fit to true for my webView. I am building this app using Swift.

                推荐答案

                请检查您是否没有在 .m 文件中编码维度.

                Do check that you haven't coded the dimensions in the .m file.

                Piyush Mathur 的答案很简单,在给定的情况下似乎很有用.

                The answer by Piyush Mathur is simple and seems usable in the given case.

                但如果需求复杂,则需要使用自动布局".

                But if the requirements are complex then you need to "Use Auto Layout".

                还要确保您已设置 Web 视图所需的所有约束.

                Also make sure that you have set all the needed constraints of the Web-View.

                Introduction to Auto-Layout 提供了设置约束的想法组件,它还可以根据设备屏幕尺寸提供拉伸组件(在您的情况下为 Web 视图)的想法.

                The Introduction to Auto-Layout gives an idea to set constraints to a component which will also give an idea to stretch component (Web-view in your case) based on the device screen size.

                这篇关于UIWebView 内容不能在不同 iPhone 尺寸之间缩放的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                相关文档推荐

                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='SQi5Q'></tbody>

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

                    <legend id='SQi5Q'><style id='SQi5Q'><dir id='SQi5Q'><q id='SQi5Q'></q></dir></style></legend>
                    <tfoot id='SQi5Q'></tfoot>

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

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