如何在页面级别添加活动指标? [英] How to add an activity-indicator on a page level?
本文介绍了如何在页面级别添加活动指标?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在我的登录页面中添加一个活动指示器小部件,但是我希望它覆盖整个屏幕,因此可以防止双击登录"按钮.
I would like to add an activity-indicator widget in my login page but I would like it to cover the whole screen, so I can prevent double click on the Login button.
任何想法,谢谢!
推荐答案
如果将所有内容包装在GridLayout中,请添加StackLayout作为要覆盖的行中的最后一项.默认情况下,StackLayout会覆盖整个屏幕.然后,您可以通过数据显示/隐藏.例如:
If you wrap everything in a GridLayout, add a StackLayout as the last item in the row you want to cover. The StackLayout by default will cover the whole screen. Then you can show/hide via data. For example:
<GridLayout>
<StackLayout>
// All your page content goes here!
</StackLayout>
<StackLayout class="dimmer" visibility="{{showLoading ? 'visible' : 'collapsed'}}"/>
<GridLayout rows="*" visibility="{{showLoading ? 'visible' : 'collapsed'}}">
<ActivityIndicator busy="true" />
</GridLayout>
</GridLayout>
我有一个调光器" StackLayout,我将其设置为半透明黑色,然后将活动指示器"放在顶部.
I have a "dimmer" StackLayout that I animate to be semi transparent black, then the Activity Indicator sits on top.
这篇关于如何在页面级别添加活动指标?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文