我正在尝试插入一个web-view在我的页面上并收听“loadFinishedEvent”...
但为了做到这一点,我需要在我的中找到网络视图成分(ts文件),通过nativescript方式我需要用标签包装我的xml(UI):
<Page xmlns="http://schemas.nativescript.org/tns.xsd
但这样做我得到了这个错误:
”类型错误:this.page.frame._getNavBarVisible 不是函数“,如果没有页面标签,我已经尝试过一些方法,但没有成功......
我也没有找到任何样本,有人可以帮助我吗?
您的 .ts 文件包含类实现
import { Component } from "@angular/core";
@Component({
selector: "Date",
templateUrl: "myPage.html", //here is your reference to html page
})
export class Angular2WebView {
//any class function
}
您的 html 文件 myPage.html
<GridLayout>
<WebView id="webView" url="http://www.google.com" >
</WebView>
</GridLayout>
了解更多信息。参考这里Nativescript 裸 webview 似乎不起作用
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)