2017-04-06 97 views
0

我需要使用iframe在即時消息開發的應用程序中顯示視頻的第一幀。將iframe添加到Appcelerator應用程序

我有我的web視圖這樣的:

var myWebView = Ti.UI.createWebView({ 
    height : deviceHeight * 0.04, 
    width : deviceHeight * 0.04, 
    left : deviceWidth * 0.03, 
    backgroundColor : "red", 
    url : "/local.html", 
}); 

,這是我local.html:

<html> 
    <body> 
     <iframe width="100" height="100" src="https:(myLink) frameborder="0"></iframe> 
    </body> 
</html> 

的問題是,在框架加載,但不佔據我的整個的WebView。

或者有沒有更好的方法來加載一個iframe到WebView的appcelerator與JavaScript?

我不知道這應該如何。

劑量有人有什麼建議,因此應該嗎?

回答

3

你真的需要圍繞它的iframe嗎?將URL設置爲鏈接也可以。

的一種方法是設置中繼檢視:https://www.w3schools.com/css/css_rwd_viewport.asp

<meta name="viewport" content="width=device-width, initial-scale=1.0"> 

如果IFRAME應全屏(不是100像素),它會是這樣的:

<body style="margin:0px;padding:0px;overflow:hidden"> 
    <iframe src="http://www.youraddress.com" frameborder="0" style="overflow:hidden;height:100%;width:100%" height="100%" width="100%"></iframe> 
</body>