2017-04-06 98 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>