对于“在意外状态下完成导航转换”该怎么办。导航栏子视图树可能会损坏。”
我正在使用 Appcelerator Titanium Mobile 编写 iPhone 应用程序。我根据焦点窗口隐藏和显示选项卡组。
dashWin.addEventListener("focus",function(e) {
if (dashWin.tabGroupVisible == true) {
dashWin.tabGroupVisible=false;
tabGroup.animate({bottom:-50,duration:500});
}
});
上面的代码在 dashWin 收到焦点事件时隐藏选项卡组。但是,当在 iPhone 模拟器中运行时触发事件时,我在 Titanium 控制台中看到此消息:
在意外状态下完成导航转换。导航栏子视图树可能会损坏。
Google 搜索会出现一个结果:另一个 StackOverflow 问题,可能会提示发生的情况在。
I'm writing an iPhone app using Appcelerator Titanium Mobile. I am hiding and showing the tab group based on what window has focus.
dashWin.addEventListener("focus",function(e) {
if (dashWin.tabGroupVisible == true) {
dashWin.tabGroupVisible=false;
tabGroup.animate({bottom:-50,duration:500});
}
});
The code above hides the tab group when dashWin receives a focus event. However, I see this message in the Titanium console when the event fires while running in the iPhone simulator:
Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted.
A Google search turns up one result: Another StackOverflow question that may have a hint as to what's going on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
当我通过故事板将
Action Segue
或Selection Segue
从一个视图链接到另一个视图并再次以编程方式执行相同的 segue 时,出现此错误,这使得导航控制器执行相同的操作继续两次。针对这种情况的 2 个解决方案:
手动部分
替换Action Segue
或Selection Segue
并执行- (void)performSegueWithIdentifier:(NSString *)identifier sender:(id )由您自己发送
。当您想要根据发件人自定义 segue 的行为时,您可能会发现此解决方案很有用。I got this error when I linked
Action Segue
orSelection Segue
from one view to another view through storyboard and performed the same segue programmatically again, which makes the navigation controller perform the same segue twice.2 solutions for this case:
Action Segue
orSelection Segue
withManual Section
and do- (void)performSegueWithIdentifier:(NSString *)identifier sender:(id)sender
by yourself. You may find this solution useful when you want to customize the behavior of segue according to the sender.通常,选项卡组充当应用程序导航的根。当用户点击选项卡时,该选项卡的窗口将获得焦点。
接下来,当用户触发需要出现新窗口的操作时,它通常会以模态方式出现或出现在当前窗口的顶部(在导航堆栈意义上)。在后一种情况下,告诉当前选项卡打开新窗口。
如果将 tabBarHidden 属性设置为 false(创建新窗口时),则当当前选项卡打开新窗口时,选项卡栏将为您隐藏。
这种更标准的方法对您有用吗?
Usually a tab group acts as the root of your app's navigation. When a user taps a tab, that tab's window is focused.
Next, when a user triggers an action that requires a new window appear, it usually appears either modally or on top (in the navigation stack sense) of the current window. In the latter case, tell the current tab to open the new window.
If you set the tabBarHidden property to false (when you create the new window), the tab bar will be hidden for you when the new window is opened by the current tab.
Will this more standard approach work for you?
我有
segues
导致回到我的主导航控制器,这导致了这个问题。我通过将主导航控制器设置回堆栈顶部来解决该问题。这是代码:I had
segues
that were leading back to my main navigation controller which was causing this. I fixed the problem by setting the main navigation controller back to the top of the stack. Here is the code:最近,我遇到了同样的问题。原因是:
-我试图错误地弹出视图控制器两次。
您可以通过在推送和弹出视图控制器上设置断点来检查此崩溃
Recently, I've faced the same problem. The reason was:
-I was trying to pop view controller twice by mistake.
you can check this crash by setting breakpoints on push and pop View controllers