在Xamarin.Forms项目,我想告诉ActivityIndicator
展现自己,然后导航到另一个页面告诉ActivityIndicator展现自己,然后导航到另一个页面
activityIndicatorObject = new ActivityIndicator()
{
HorizontalOptions = LayoutOptions.CenterAndExpand,
Color = Color.Red,
IsVisible = false,
IsRunning = false,
IsEnabled = false,
BindingContext = this,
};
ViewBookButton = new Button{ Text = "view book" };
ViewBookButton.Clicked += ViewBook;
protected void ViewBook(Object sender,EventArgs e)
{
//Go To View Book Page
activityIndicatorObject .IsVisible = true;
activityIndicatorObject .IsRunning = true;
activityIndicatorObject .IsEnabled = true;
activityIndicatorObject .SetBinding(ActivityIndicator.IsVisibleProperty, "IsBusy");
this.IsBusy = true;
Navigation.PushAsync(new BookPage());
this.IsBusy = false;
}
ActivityIndicator
不显示?我如何让它显示?
,而不是它的值得一提的,因为你加载了新的一页,这将在'UI做Thread'这种负荷将阻止'UI Thread'也就是说即使你确实得到了一个活动指示器来显示它不会旋转,因为UI线程将被页面加载阻止 – user1