iPhone中的webview显示iframe中的页面宽度超出屏幕

2018-4-22 liyangweb.com 李杨 HTML

今日在做一个项目,遇到了iPhone中iframe页面超宽的问题,业务场景大致是这样:

1.项目运行环境是移动端浏览器,APP中的webview,支持Android和iOS

2.页面中有一个iframe,包含了多个不同的外部链接,我们无法对此页面中的内容做任何更改

由于开发都是用PC模拟手机来进行的,本人使用的Android手机,开发完成后简单测试没发现任何问题,但是后期在iPhone中测试的时候,却发现,外部链接竟然有一半以上不能正常显示,经过各种尝试以及找了很多资料,最后终于找到一个完美解决的办法。

代码如下:

<div style="overflow: auto;-webkit-overflow-scrolling:touch;width:100%;height:100%;">
    <iframe src="http://www.baidu.com" frameborder="0" height="100%" scrolling='no' style="width: 1px; min-width: 100%; *width: 100%;"></iframe>
</div>

评论:

天津网站建设
2019-01-13 17:56
很不错的方法,这个收藏了
livyourdreamz
2019-01-04 10:54
<a href="http://www.alverish.com/nike-kobe-schuhe-line-up-obuvc">nike kobe schuhe line up</a> <a href="http://www.divaadiamante.com/air-jordan-yeezy-2-r%C3%B8d-sort-scarpea">air jordan yeezy 2 r酶d sort</a> <a href="http://www.issnederland.com/nike-air-force-1-high-07-wei%C3%9F-scarpee">nike air force 1 high 07 wei脽</a> <a href="http://www.joannapage.com/where-to-purchase-jordan-11-legend-bleu-obuvc">where to purchase jordan 11 legend bleu</a> <a href="http://www.lukasshort.com/nike-shox-marrone-blu-scarpea">nike shox marrone blu</a> <a href="http://www.pedtrauma.com/nike-noir-and-blanc-free-trainer-femmes-chaussuresf">nike noir and blanc free trainer femmes</a>
livyourdreamz http://www.livyourdreamz.com/
magicstockdz
2019-01-04 10:09
<a href="http://www.tipicousa.com/nike-flyknit-lunar-3-herre-s%C3%B8lv-skoa">nike flyknit lunar 3 herre s酶lv</a> <a href="http://www.reprebates.com/the-hermes-scarf-book-scarfr">the hermes scarf book</a> <a href="http://www.goeaglepointe.com/grey-mens-nike-roshe-yeezy-boost-shoes-sneakere">grey mens nike roshe yeezy boost shoes</a> <a href="http://www.ykloans.com/nike-mercurical-victory-vi-tf-purple-orange-black-soccer-cleats-shoesa">nike mercurical victory vi tf purple orange black soccer cleats</a> <a href="http://www.servicioswom.com/oakley-holbrook-sunglasses-clear-sunglassesr">oakley holbrook sunglasses clear</a> <a href="http://www.drlunaworld.com/ralph-lauren-yarmouth-shirt-size-guide-quiz-test-polod">ralph lauren yarmouth shirt size guide quiz test</a>
[url=http://www.magicstockdz.com/]magicstockdz[/url]
djprofi
2018-12-30 06:39
<a href="http://www.fleetboilers.com/nike-blazers-pearl-blanco-kurpesb">nike blazers pearl blanco</a> <a href="http://www.jettstreaminc.com/adidas-roshe-run-svart-kurpesd">adidas roshe run svart</a> <a href="http://www.maverickviral.com/kobe-11-high-rosso-kaufen-kurpesc">kobe 11 high rosso kaufen</a> <a href="http://www.iubhlis.com/adidas-pr%C3%B8dator-lz-ii-hvid-orange-sort-scarpec">adidas pr酶dator lz ii hvid orange sort</a> <a href="http://www.djterryhunter.com/nike-free-run-5.0-bl%C3%A5-and-gr%C3%B8nn-kit-schuhee">nike free run 5.0 bl氓 and gr酶nn kit</a> <a href="http://www.msdarby.com/nike-free-3.0-v4-bleu-gray-femmes-fonctionnement-chaussures-vente-obuvf">nike free 3.0 v4 bleu gray femmes fonctionnement chaussures vente</a>
djprofi http://www.djprofi.com/
代寫essay
2018-04-27 01:49
收藏了,赞赞。

发表评论:

Powered by emlog 冀ICP备13011830号-1