打破 TabGroup 和新窗口的默认行为
通常,在选项卡中打开一个窗口非常简单,
Ti.UI.currentTab.open(
Ti.UI.createWindow( {url: 'foo.js'} )
, {animated: true }
);
但是,这会启动 UI 面包屑的“导航组”样式。 “后退”按钮会自动放置在导航栏上。
有没有办法在当前选项卡中打开一个窗口,但从新的历史记录开始?或者“横向”移动到新窗口 - 本质上取代当前窗口?
为了确保我清楚,请考虑这个窗口层次结构。
root
/ \
child1 child2
/ \
child3 child4
在每种情况下,特定的用户操作都会在当前选项卡中打开两个窗口之一。
如果我想要单击 child3 按钮来打开 child4,同时尊重上述视图层次结构,该怎么办?我不希望“back”转到child3,我希望它转到child2。像这样
root
/ \
child1 child2
/ \
child3----> child4
或者如果我希望“返回”消失,有效地开始新的导航历史记录怎么办?
Typically, opening a window in a tab is pretty straighforward
Ti.UI.currentTab.open(
Ti.UI.createWindow( {url: 'foo.js'} )
, {animated: true }
);
However, this initiates the "navigation group" style of UI breadcrumbs. A "back" button is automatically placed on the nav bar.
Is there any way to open a window, in the current tab, but start from a fresh history? Or make a "lateral" move to a new window - essentially replacing the current?
To make sure I'm clear, consider this window hierarchy
root
/ \
child1 child2
/ \
child3 child4
In each case, a specific user action will open one of two windows into the current tab.
What if I wanted for a button click on child3 to open child4 while respecting the above view heirachy? I wouldn't want "back" to go to child3, I'd want it to go to child2. Like this
root
/ \
child1 child2
/ \
child3----> child4
Or what if I wanted "back" to just be gone, effectively starting a new navigation history?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为您可以通过执行非动画关闭然后打开来完成“横向”移动:
但是,我认为您不能在根窗口上执行此操作以便从“新历史记录”开始。
I think you can accomplish the "lateral" move by doing a non-animated close, followed by an open:
However, I do not think you can do this on the root window in order to start from a "fresh history".
我注意到这个孩子3 --> child4 的行为与我在窗口中获得的行为非常相似,该窗口主要显示带有本地 HTML 文档的 Web 视图,并且该 HTML 具有指向另一个本地 HTML 文档的超链接。
I've noticed that this child3 --> child4 behavior is very similar to what I get in a window which is predominantly displaying a web view with a local HTML document, and the HTML has a hyper link to another local HTML document.