Nativescript GridLayout在typescript中设置行高

Nativescript GridLayout在typescript中设置行高,nativescript,nativescript-angular,Nativescript,Nativescript Angular,是否有方法在绘制GridLayout行后更改/设置其高度 例如,我的GridLayout设置如下: <GridLayout class="template_body" rows="40,*,60"> <StackLayout row="0" [visibility]="isTablet ? 'visible' : 'collapsed'"> <Label text="Drag statements to the proper category.">&l

是否有方法在绘制GridLayout行后更改/设置其高度

例如,我的GridLayout设置如下:

<GridLayout class="template_body" rows="40,*,60">
<StackLayout row="0" [visibility]="isTablet ? 'visible' : 'collapsed'">
    <Label text="Drag statements to the proper category."></Label>
    <FlexboxLayout flexDirection="row" row="1" [visibility]="isSubmitted ? 'visible' : 'collapsed'">
            <AbsoluteLayout height="10" width="10" class="correct-legend"></AbsoluteLayout><Label class="legend-label" text="Correct"></Label>
            <AbsoluteLayout height="10" width="10" class="incorrect-legend"></AbsoluteLayout><Label class="legend-label" text="Incorrect"></Label>
        </FlexboxLayout>
</StackLayout>

我想根据条件更改第一行的高度。至行=“100,*,60”


我尝试在gridlayout上使用getRows()获取行,但似乎无法处理返回的内容。它似乎返回的是一个可观察的行数组,而不是api所说的应该返回的行数组。

如果您希望获得比rows=“auto,*,auto”所提供的更多的控制权,您可以给gridlayout一个id,例如id=“someId”,然后在js/ts中尝试

page.getViewById("someId").rows="100, *,60"; 
page.getViewById("someId").requestLayout();

您可以尝试将行设置为
auto
例如rows=“auto,*auto”,并更改内容布局的大小,例如
myStack.height=300