在iOS应用程序中未调用MvvmCross中的SaveState [英] SaveState in MvvmCross is not being called in an iOS application

查看:102
本文介绍了在iOS应用程序中未调用MvvmCross中的SaveState的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用MvvmCross v3.5来构建iOS应用程序.每当应用程序进入后台时,我都希望在视图模型中调用SaveState.

I am using MvvmCross v3.5 to build an iOS application. Whenever the application goes into the background I am expecteing SaveState to be called in the view model.

但是它永远不会被调用.我已经在模拟器和设备上都尝试过了.我错过了什么吗?

However it never gets called. I have tried this both on the simulator and a device. Am I missing something.

这在该应用的Android版本中有效,因此我认为我已正确设置了它.

This works in the Android version of the app, so I think I have set it up correctly.

还有其他人遇到过这个问题吗?任何帮助将不胜感激.

Has anyone else got this issue? Any help would be appreciated.

推荐答案

我认为在Xamarin中,您需要实现UIApplicationDelegate.ShouldRestoreApplicationState和ShouldSaveApplicationState以返回true.

I think in Xamarin you need to implement UIApplicationDelegate.ShouldRestoreApplicationState and ShouldSaveApplicationState to return true.

这篇关于在iOS应用程序中未调用MvvmCross中的SaveState的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆