簡體   English   中英

Cordova中的瀏覽器應用程序

[英]browser application in cordova

我在Apache cordova中創建了一個程序。 我的程序只是用於打開網站的iframe。
但是我在滾動5頁之前的android版本中有問題。 我的問題在圖片中:

可以看出,文本放置不正確。

我的代碼是這樣

<div data-role="page" data-theme="a">        
    <div data-role="content" data-theme="a" id="theParent" style="height:100%; padding:0px; overflow:scroll !important;-webkit-overflow-scrolling:touch !important;">
        <!--<button id="myBtn" onclick="gourl();"> go to url </button>-->
        <iframe style="width:100%; border:0px; height:100%;" scrolling="yes" frameborder="0" src="http://shahreman.biz" id="urlshow">
        </iframe>

        <script>
            //document.getElementById("myBtn").addEventListener("click", gourl());
            //var physicalScreenHeight = window.screen.height * window.devicePixelRatio;
            var physicalScreenHeight = window.innerHeight;
            //physicalScreenHeight=(physicalScreenHeight/100)*97;
            var heightiframe=physicalScreenHeight+"px"
            //alert(heightiframe);
            document.getElementById('urlshow').style.height=heightiframe;
            function gourl()
            {
                document.getElementById('urlshow').src = 'http://shahreman.biz';
            }
        </script>

    </div>
</div>

這僅僅是因為您不打算使用iframe在Cordova中構建應用程序。 您可以使用PhoneGap並將html和所有內容放入一個新項目中,然后使用PhoneGap Desktop模擬器或使用CLI運行它,以查看其在移動設備中的工作方式。 從捕獲看來,您似乎有divs問題的填充。 祝好運

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM