Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/xamarin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
当应用程序在后台和前台之间切换时,ListView pulltorefresh activityindicator处于冻结状态_Listview_Xamarin_Xamarin.ios_Xamarin.forms - Fatal编程技术网

当应用程序在后台和前台之间切换时,ListView pulltorefresh activityindicator处于冻结状态

当应用程序在后台和前台之间切换时,ListView pulltorefresh activityindicator处于冻结状态,listview,xamarin,xamarin.ios,xamarin.forms,Listview,Xamarin,Xamarin.ios,Xamarin.forms,我正在Xamarin表单应用程序上实现表单页面的列表视图。已启用对相同对象的拉刷新 每当拉动列表时,活动指示器开始设置动画,我开始后台任务。现在,当按下home(主页)按钮将应用程序发送到后台,并通过单击主页或任务菜单上的应用程序图标将其带回前台时,活动指示器将冻结。但后台任务仍在运行,当它完成时,我调用 IsRefreshing = false; 它的行为正常,活动指示器消失,listview向上移动 如何使activityindicator在到达前台后再次恢复动画?只有在iOS上才

我正在Xamarin表单应用程序上实现表单页面的列表视图。已启用对相同对象的拉刷新

每当拉动列表时,活动指示器开始设置动画,我开始后台任务。现在,当按下home(主页)按钮将应用程序发送到后台,并通过单击主页或任务菜单上的应用程序图标将其带回前台时,活动指示器将冻结。但后台任务仍在运行,当它完成时,我调用

    IsRefreshing = false;
它的行为正常,活动指示器消失,listview向上移动


如何使activityindicator在到达前台后再次恢复动画?只有在iOS上才能看到这一点,Android运行良好

您可以尝试使用它

IsRefreshing = true;
try{
    // Your task running here. You can also implement catch and display it on DisplayAlert
}finally{
    IsRefreshing = false;
}
如果你想在你的应用或页面出现时放置一个方法或请求,你应该试试这个

protected override void OnAppearing()
{
    // put something here when app is on appearing
}
或者App.xaml.cs中的这个

protected override void OnResume()
{
    // Handle when your app resumes
}

你可以试着用这个

IsRefreshing = true;
try{
    // Your task running here. You can also implement catch and display it on DisplayAlert
}finally{
    IsRefreshing = false;
}
如果你想在你的应用或页面出现时放置一个方法或请求,你应该试试这个

protected override void OnAppearing()
{
    // put something here when app is on appearing
}
或者App.xaml.cs中的这个

protected override void OnResume()
{
    // Handle when your app resumes
}

什么是
IsRefreshing
(以大写字母
I
?)以及为什么要提及它?什么是
IsRefreshing
(以大写字母
I
?)以及为什么要提及它?我已经更新了我的问题,以准确反映我的问题所在。当任务运行时,我们将应用程序移到后台并返回前台,listview上方的activityindicator将停止动画。我添加了一些提示或其他想法。我已更新我的问题,以准确反映我的问题。当任务运行时,我们将应用程序移到后台并返回前台,listview上方的activityindicator将停止设置动画。我添加了一些提示或其他想法