如果我运行 tutorial 的实现在 MainMenuView 上并按后退将退出应用程序,但在我的应用程序中,它只是转到 SplashScreenView 并重定向回 MainMenuView,我无法在教程中找到其指定或覆盖单击后退按钮时发生的情况
编辑: 在这里找到解决方案 https://github.com/slodge/MvvmCross/blob/master/Sample%20-%20Tutorial/Tutorial/Tutorial.UI.Droid/SplashScreenActivity.cs
[Activity(Label = "Tutorial.UI.Droid", MainLauncher = true, NoHistory = true, Icon = "@drawable/icon")]
public class SplashScreenActivity
: MvxBaseSplashScreenActivity
{
public SplashScreenActivity()
: base(Resource.Layout.SplashScreen)
{
}
protected override void OnViewModelSet()
{
// ignored
}
}
最佳答案
没有任何隐藏代码 - 它只是 Android 后退堆栈。
您确定您的应用程序确实正常退出吗?听起来有点像您的应用程序崩溃并重新启动?检查调试日志以找出答案。
或者,您也可能错过了启动屏幕上的 nohistory 标志
关于xamarin.android - 使用后退按钮关闭 Mvvmcross 教程,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12599729/