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

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

      <tfoot id='s5nLg'></tfoot>

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

        使用 UIWebView 时奇怪的填充/边距

        Strange padding/margin when using UIWebView(使用 UIWebView 时奇怪的填充/边距)
        <legend id='qqIqD'><style id='qqIqD'><dir id='qqIqD'><q id='qqIqD'></q></dir></style></legend>

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

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

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

                  本文介绍了使用 UIWebView 时奇怪的填充/边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在创建一个应用程序,它的 UIWebView 包含一个广告.视图的大小与广告(图像)本身相同.尽管如此,在 UIWebView 内部,图像的上方和左侧仍有某种白色边距/填充.查看链接图片:

                  I am creating an app that is having a UIWebView which contains an advert. The size of the view is the same as the advert (image) itself. Still, there is a white margin/padding of some kind above and to the left of the image, inside the UIWebView. Check out the linked image:

                  实际上,由于这种填充,图像也被向下和向右推.

                  Actually, the image is pushed down and to the right due to this padding also.

                  知道我应该如何删除白色填充吗?

                  Any idea how I should remove the white padding?

                  提前致谢!

                  推荐答案

                  基本上,所有浏览器都会在页面边缘添加空白,以便与 Netscape 1 向后兼容.在您加载的 HTML 中web 视图,你可以使用 CSS 来移除它:

                  Basically, all browsers add in that whitespace around the edges of the page to be backwards-compatible with like Netscape 1. In the HTML you're loading into the web view, you can use CSS to remove that:

                  body { margin: 0; padding: 0; }
                  

                  如果您没有将 HTML 加载到 Web 视图中,而只是将图像文件的直接 URL 加载到其中,我建议 a) 将其包装在一些基本的 HTML 中(head、body、img标记),或者 b) 自己下载图像(例如使用 NSURLConnection),并直接在 UIImageView 中显示它.

                  If you're not loading HTML into your web view, but just the direct URL for an image file, I suggest either a) wrapping that in some basic HTML (head, body, an img tag), or b) downloading the image yourself (say with NSURLConnection), and displaying it directly in a UIImageView.

                  这篇关于使用 UIWebView 时奇怪的填充/边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Hardware Volume buttons change in app volume(硬件音量按钮更改应用程序音量)
                  Cocos2d - How to check for Intersection between objects in different layers(Cocos2d - 如何检查不同层中对象之间的交集)
                  Highlight Read-Along Text (in a storybook type app for iPhone)(突出显示朗读文本(在 iPhone 的故事书类型应用程序中))
                  Cocos2D + Disabling only Retina iPad Graphics(Cocos2D + 仅禁用 Retina iPad 图形)
                  How to convert 32 bit PNG to RGB565?(如何将 32 位 PNG 转换为 RGB565?)
                  Proper cocos2d scene restart?(正确的 cocos2d 场景重启?)

                      <tbody id='PEZFN'></tbody>
                  • <small id='PEZFN'></small><noframes id='PEZFN'>

                      <bdo id='PEZFN'></bdo><ul id='PEZFN'></ul>
                      <tfoot id='PEZFN'></tfoot>

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