【发布时间】:2018-10-11 19:58:33
【问题描述】:
我正在尝试获取StackLayout 的高度。这个布局充满了来自我后端的数据,所以它并不总是相同的高度。我试过view.getViewById(parent, selector).effectiveHeight,但它一直在输出0。
我的 XML 文件看起来有点像这样:
<Page>
<ActionBar title="..."></ActionBar>
<GridLayout rows="*, auto" columns="*">
<ScrollView row="0" col="0">
<GridLayout rows="*" columns="*">
<StackLayout id="TARGET" row="0" col="1">
<StackLayout *ngFor="let x of y">
<FlexboxLayout justifyContent="space-between">
<FlexboxLayout>
<StackLayout>
...
</StackLayout>
</FlexboxLayout>
<FlexboxLayout justifyContent="space-between">
...
</FlexboxLayout>
</FlexboxLayout>
</StackLayout>
</StackLayout>
<StackLayout col="0" row="0">
...
</StackLayout>
</GridLayout>
</ScrollView>
<StackLayout row="1" col="0">
...
</StackLayout>
</GridLayout>
</Page>
提前谢谢你!
【问题讨论】:
标签: nativescript angular2-nativescript nativescript-telerik-ui nativescript-angular nativescript-cli