我想顯示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是內置的。它用於打開和關閉狀態欄活動圖標 - 但你也可以在你自己的代碼中使用它,就像在這裏完成 –