我想显示ActivityIndicator
当我试图更新列上的数据库时,按下按钮后,它不出现?问题是什么?活动指示灯不工作Xamarin.forms
在下面我的代码:
ActivityIndicator ai = new ActivityIndicator()
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
Color = Color.Black
};
ai.IsRunning = true;
ai.IsEnabled = true;
ai.BindingContext = this;
ai.SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
ProcessToCheckOut = new Button { Text = "Set Inf" };
ProcessToCheckOut.Clicked += (object sender, EventArgs e) =>
{
this.IsBusy = true;
UserUpdateRequest user=new UserUpdateRequest();
user.userId = CustomersPage.ID;
appClient.UpdateInfo(user);
this.IsBusy = false;
Navigation.PushAsync(new CheckoutShippingAddressPage(appClient));
};
Content = new StackLayout
{
Children={
tb,
ai,
ProcessToCheckOut
}
};
样?它是一个Bindable属性? – StarterPack
ProcessToCheckOut是按钮..我应该添加一个属性?! –
@StarterPack IsBusy是内置的。它用于打开和关闭状态栏活动图标 - 但你也可以在你自己的代码中使用它,就像在这里完成 –