我有这个简单的页面布局:
<ActionBar title="Events" class="action-bar"></ActionBar>
<StackLayout class="page">
<ListView [items]="events" class="list-group" [class.visible]="listLoaded" *ngIf="events">
<ng-template let-item="item">
<StackLayout class="list-group-item" (tap)="viewDetails(item)">
<Label class="h3" [text]="item.nome"></Label>
</StackLayout>
</ng-template>
</ListView>
<ActivityIndicator [busy]="isLoading" [visibility]="isLoading ? 'visible' : 'collapse'" horizontalAlignment="center" verticalAlignment="center"></ActivityIndicator>
</StackLayout>
当组件加载数据时,活动指示器显示在页面顶部。现在我希望它出现在页面的中心,所以我将它从堆叠布局中弹出
<ActionBar title="Events" class="action-bar"></ActionBar>
<ActivityIndicator [busy]="isLoading" [visibility]="isLoading ? 'visible' : 'collapse'" horizontalAlignment="center" verticalAlignment="center"></ActivityIndicator>
<StackLayout class="page">
<ListView [items]="events" class="list-group" [class.visible]="listLoaded" *ngIf="events">
<ng-template let-item="item">
<StackLayout class="list-group-item" (tap)="viewDetails(item)">
<Label class="h3" [text]="item.nome"></Label>
</StackLayout>
</ng-template>
</ListView>
</StackLayout>
但它不再可见!知道发生了什么吗?