在TitleWindow中使用TabbedViewNavigator

时间:2013-10-11 12:04:35

标签: actionscript-3 flex flash-builder flex4.6 tabbed-view

我正在制作一个Flex mobile 4.6应用程序,它是ViewNavigatorApplication(不确定这是否会对以下内容产生任何影响)。这个应用程序有一个自定义的ActionBar,在下面的屏幕截图中可见。

麻烦从这里开始:我想使用TitleWindow作为弹出窗口,它将显示TabbedViewNavigator中包含的一些选项。所以基本上是:ViewNavigatorApplication中的TitleWindow中的TabbedViewNavigator。

这是我在简单地添加TabbedViewNavigator时得到的: enter image description here

显然,我的主窗口的操作栏在我的TitleWindow中是重复的,这显然不是我想要的。 到目前为止,这是我的TitleWindow的代码:

<s:TitleWindow xmlns:fx="http://ns.adobe.com/mxml/2009" 
           xmlns:s="library://ns.adobe.com/flex/spark" creationComplete="addedToStageHandler(event)">
<fx:Script>
    <![CDATA[
        import mx.events.CloseEvent;
        import mx.events.FlexEvent;
        import mx.managers.PopUpManager;

        private var softKeyboardPanTimer:Timer = new Timer(250, 1);

        protected function closeHandler(event:CloseEvent):void
        {
            stage.focus = null;
            softKeyboardPanTimer.addEventListener(TimerEvent.TIMER, onSoftKeyboardClosed);
            softKeyboardPanTimer.start();
        }

        private function onSoftKeyboardClosed(event:TimerEvent):void
        {
            stage.focus = null;
            PopUpManager.removePopUp(this);
        }

        protected function centerPopUp(e:Event):void
        {
            PopUpManager.centerPopUp(this);
        }

        protected function addedToStageHandler(event:Event):void
        {
            stage.addEventListener(StageOrientationEvent.ORIENTATION_CHANGE, centerPopUp, false, 0, true);   
            this.closeButton.visible = false;
        }

    ]]>
</fx:Script>
<fx:Declarations>
    <!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>

<s:Rect width="100%" height="100%">
    <s:fill>
        <s:LinearGradient rotation="90">
            <s:GradientEntry ratio="0" color="#ffffff"/>
            <s:GradientEntry ratio="1" color="#f8f8f8"/>
        </s:LinearGradient>
    </s:fill>
</s:Rect>

<s:Group x="0" y="0" width="100%" height="100%">
    <s:layout>
        <s:VerticalLayout paddingLeft="10" paddingRight="10" paddingBottom="10" paddingTop="10"/>
    </s:layout>
    <s:TabbedViewNavigator>
        <s:ViewNavigator label="Tab 1"/>
        <s:ViewNavigator label="Tab 2"/>
        <s:ViewNavigator label="Tab 3"/>
    </s:TabbedViewNavigator>
</s:Group>


</s:TitleWindow>

还有一个信息:点击操作栏中重复的第四个图标即可打开此弹出窗口。

我有什么想法可以摆脱鬼棒吗?

2 个答案:

答案 0 :(得分:1)

要创建“标签栏”,您实际上可以使用带有TabbedViewNavigatorTabBarSkin的ButtonBar - 正如您在我的示例中所见:

Styling ButtonBar font in Flex mobile app - with screenshot attached

我不确定TitleWindow,它可能无法在移动应用中使用,但您可以使用Callout

答案 1 :(得分:-1)

终于发现了这个问题......我忘了这件实际负责原始ActionBar皮肤的CSS:

s|ActionBar
{
skinClass: ClassReference("aproove.presentation.ActionBarSkin");
} 

由于TabbedViewNavigator包含一个ActionBar,因此弹出窗口中会应用相同的外观。愚蠢的嘿嘿;)

相关问题