【发布时间】:2026-02-13 09:35:01
【问题描述】:
在其他所有地方导航都可以正常工作,只有在这个地方它不起作用(它像所有其他 Viewmodel 一样设置)
我正在尝试从 ImportView (ImportViewModel) 导航到 LoginView (LoginViewModel)。
在 Buttonclick(ViewModel 中的绑定 MvxCommand)上,我正在调用 ShowViewModel<LoginViewModel>();
它的工作,但之后整个导航被破坏了。如果我现在从新打开的 LoginViewModel 移动到 Example TestViewModel(或 TestView),现在“返回”,我不会返回 LoginView,而是返回到 BlackScreen,然后还有一个“返回”应用崩溃... (MonoTouch.Foundation.MonoTouchException: Objective-C exception thrown. Name: NSInvalidArgumentException Reason: Can't add self as subview)
问题出在哪里?
这里有一些调试信息:
[0:] mvx:Warning: 26.41 Don't know how to close this viewmodel - topmost view does not present this viewmodel
[0:]
2013-12-13 13:19:28.400 INMobileAdminUIiOS[6932:60b] mvx:Diagnostic: 26.81 Showing ViewModel LoginViewModel
[0:] mvx:Diagnostic: 26.81 Showing ViewModel LoginViewModel
[0:]
2013-12-13 13:19:28.799 INMobileAdminUIiOS[6932:60b] TouchNavigation:Diagnostic: 27.21 Navigate requested
[0:] TouchNavigation:Diagnostic: 27.21 Navigate requested
2013-12-13 13:19:29.085 INMobileAdminUIiOS[6932:60b] nested push animation can result in corrupted navigation bar
[0:]
2013-12-13 13:19:29.224 INMobileAdminUIiOS[6932:601f] 13.12.2013 13:19:29 TinyMessage: ProgressDialogDismissMessage
[0:] 13.12.2013 13:19:29 TinyMessage: ProgressDialogDismissMessage
2013-12-13 13:19:29.463 INMobileAdminUIiOS[6932:60b] Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
【问题讨论】:
-
可能显示代码 - 例如一个重现问题的简单应用程序。这里有很多关于嵌套推送动画的点击 - *.com/search?q=nested+push+animation
-
我构建了一个简单的应用程序,但无法重现该问题。但我确实以某种方式修复了它,看看我的答案。
标签: xamarin.ios navigation viewmodel mvvmcross