美文网首页
mui入门--webview

mui入门--webview

作者: lydia56 | 来源:发表于2018-03-12 16:32 被阅读0次

1.webview是什么
html5plus中的webview是对原生webview的封装,一个html页面可以创建多个webview。可用于子页面切换。
2.创建
WebviewObject plus.webview.create( url, id, styles, extras );
例:

var chat = plus.webview.create( 'chat.html', 'chat', {top:'45px',bottom:'50px'} ); //子页面

3.显示
void plus.webview.show( id_wvobj, aniShow, duration, showedCB, extras );
例:

chat.show()

4.隐藏
void plus.webview.hide( id_wvobj, aniHide, duration, extras );

chat.hide()

5.获取当前页面所属的Webview窗口对象

WebviewObject plus.webview.currentWebview();
plus.webview.currentWebview().getURL(); //打印当前页面url

例:

var self = plus.webview.currentWebview()

6.创建并打开

WebviewObject plus.webview.open( url, id, styles, aniShow, duration, showedCB );

例:

var chat = plus.webview.open( 'chat.html', 'chat', {top:'45px',bottom:'50px'} ); 

相关文章

网友评论

      本文标题:mui入门--webview

      本文链接:https://www.haomeiwen.com/subject/vyanfftx.html