【发布时间】:2018-01-19 13:49:10
【问题描述】:
有没有办法在 Nativescript 中默认“隐藏”一个元素?
我的组件中有
export class HouseholdContactComponent{
private isLoading = true
}
在我的 xml 中
<StackLayout [visibility]="isLoading ? 'collapse' : 'visible'">
<Label text="Hi there"></Label>
</StackLayout>
使用此代码,屏幕会闪烁“您好”消息,然后消失。
【问题讨论】:
-
为什么不使用
ngIf? -
我使用了您共享的代码并解决了我的问题。感谢您的提问;-)
标签: angular nativescript angular2-nativescript