问题描述
参考:
我有2个选项卡。 Tab1有2个子视图:
Tab1
Tab1subViewA
Tab1subViewB
Tab2
<$在Tab1中(Tab1SubViewA是第一个)。在Tab1中,Tab1SubViewA是第一个查看), - >我导航到Tab1SubViewB(仍然在Tab1下)。
如何返回上一个视图(Tab1SubViewA)?注意:它并不是从标签页移动到标签页,而是从视图移到同一个标签页的所有页面。
$ b $代码为Tab1SubViewA:
<?xml version =1.0encoding =utf- 8\" >?;
< s:查看xmlns:fx =http://ns.adobe.com/mxml/2009
xmlns:s =library://ns.adobe.com/flex/spark title =Tab1subViewA>
< / s:视图>
TabbedViewNavigatorApplication中的代码:
...
< s:titleContent>
< / s:titleContent>
< / s:ViewNavigator>
< s:titleContent>
< / s:titleContent>
< / s:ViewNavigator>
< / s:TabbedViewNavigatorApplication>
我发现了一个简单的方法,编码。如果你真的没有很多的意见进入每个标签(大多不是),硬编码并不是那么糟糕。那么,如果有人想要给上面的非硬代码解决方案是值得欢迎的。
Refer back to : flex mobile TabbedViewNavigatorApplication back button
I have 2 Tabs. Tab1 has 2 sub Views:
Tab1
Tab1subViewA
Tab1subViewB
Tab2
subview...
In Tab1 (Tab1SubViewA is the first View), -> I navigate to Tab1SubViewB (still under Tab1).
How can I go back to previous view (Tab1SubViewA)?
Note: it's not moving from Tab to Tab but moving from View to View all in the same Tab.
code for Tab1SubViewA:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="Tab1subViewA">
<s:Button click="{navigator.pushView(Tab1subViewB)}" />
</s:View>
code in TabbedViewNavigatorApplication:
...
<s:ViewNavigator firstView="views.Tab1subViewA" label="Page1" height="100%" width="100%" >
<s:titleContent>
<s:Button click="BackBtn(event)" label="Back"/>
</s:titleContent>
</s:ViewNavigator>
<s:ViewNavigator firstView="views.Tab1subViewB" label="Page2" height="100%" width="100%">
<s:titleContent>
<s:Button click="BackBtn(event)" label="Back"/>
</s:titleContent>
</s:ViewNavigator>
</s:TabbedViewNavigatorApplication>
i found one simple way of doing it, just hard code it. If you really don't have a lot of views into each Tab (and mostly don't anyway), hard coding it is not that bad. Well, if anyone want to give a non-hard code solution to the above is welcome.
这篇关于flex移动TabbedViewNavigatorApplication后退按钮part2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!