【发布时间】:2019-05-13 22:09:53
【问题描述】:
我正在尝试从 NativeScript Angular 获取 StackLayout nativeView,但总是返回 undefined。我试过这样:
html:
<StackLayout id="stackLayout" #stackLayout> </StackLayout>
TS:
ngAfterViewInit() {
setTimeout(() => {
let container: StackLayout = this.page.getViewById("stackLayout");
console.log(container.nativeView);
console.log(this.stackLayout.nativeElement.nativeView);
}, 100)
}
请给我建议。
【问题讨论】:
标签: nativescript nativescript-angular