Nativescript angular 在角度为8+;Nativescript
我有一个视图显示一个有两列的表。我必须基于切换按钮单击隐藏/显示列。当我使用visibility属性并更改第二列的可见性时,我看到第一列并没有占据整个屏幕Nativescript angular 在角度为8+;Nativescript,nativescript-angular,android-gridlayout,Nativescript Angular,Android Gridlayout,我有一个视图显示一个有两列的表。我必须基于切换按钮单击隐藏/显示列。当我使用visibility属性并更改第二列的可见性时,我看到第一列并没有占据整个屏幕 <RadListView row=" 2" [items]="itemList"> <ng-template let-item="item" > <GridLayout columns=&qu
<RadListView row=" 2" [items]="itemList">
<ng-template let-item="item" >
<GridLayout columns="*,*" class="" >
<Label column="0" [text]="item.labelid + '.' + item.text[0]" textwrap="true"
class="p-15 border-table text_font"></Label>
<Label column="1" [id]="item.labelid" [text]="item.labelid + '.' + item.text[1]" textwrap="true"
class="p-15 border-table text_font"></Label>
</GridLayout>
</ng-template>
</RadListView>
组件技术
onCompareTap(args) {
this.isCompare = !this.isCompare
this.itemList.forEach((item) => {
var crLabel:Label = <Label>this.page.getViewById(item.labelid);
crLabel.visibility= this.isCompare ? 'visible' : 'collapse';
})
}
onCompareTap(args){
this.isCompare=!this.isCompare
this.itemList.forEach((项)=>{
var crLabel:Label=this.page.getViewById(item.labelid);
crLabel.visibility=this.isCompare?“可见”:“折叠”;
})
}
我想在用户切换视图时显示占据全屏的单列。诀窍在于定位GridLayout columns=“*,*”
,其中我指定了在运行时无法更改的列数。请想一想