flex mobile TabbedViewNavigatorApplication back button part2

ぃ、小莉子 提交于 2020-02-06 06:33:53

问题


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>

回答1:


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.



来源:https://stackoverflow.com/questions/9235784/flex-mobile-tabbedviewnavigatorapplication-back-button-part2

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!