如何处理“在意外状态下完成导航转换".导航栏子视图树可能会损坏." [英] What to do about "Finishing up a navigation transition in an unexpected state. Navigation Bar subview tree might get corrupted."

查看:15
本文介绍了如何处理“在意外状态下完成导航转换".导航栏子视图树可能会损坏."的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 Appcelerator Titanium Mobile 编写 iPhone 应用程序.我根据哪个窗口具有焦点隐藏和显示选项卡组.

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});
    }
});

当 dashWin 收到焦点事件时,上面的代码隐藏选项卡组.但是,当事件在 iPhone 模拟器中运行时触发时,我在 Titanium 控制台中看到此消息:

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.

Google 搜索会出现一个结果:另一个 StackOverflow 问题,可能有以下提示发生了什么事.

A Google search turns up one result: Another StackOverflow question that may have a hint as to what's going on.

推荐答案

通常选项卡组充当应用导航的根.当用户点击一个选项卡时,该选项卡的窗口会被聚焦.

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.

如果您将 tabBarHidden 属性设置为 false(当您创建新窗口时),则当当前选项卡打开新窗口时,选项卡栏将为您隐藏.

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?

这篇关于如何处理“在意外状态下完成导航转换".导航栏子视图树可能会损坏."的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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