0

ViewNavigator 默认在顶部有 ActionBar。我想在底部移动。

navigator.actionbar.y=415 //获取底部的actionbar

但在下一个视图中,它又回到了顶部。您可以在每个视图中设置高度,但它会在顶部显示栏几秒钟,然后再回到底部。

4

1 回答 1

2

您想要对 ViewNavigator 进行蒙皮以将 ActionBar 放在底部。

在主应用程序中,您可以添加样式:

<fx:Style>
    @namespace s "library://ns.adobe.com/flex/spark";

    s|ViewNavigator {
        skinClass: ClassReference("CustomViewNavigatorSkin")
    }

</fx:Style>

然后,创建你的CustomViewNavigatorSkin类:

<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
        xmlns:s="library://ns.adobe.com/flex/spark">
    <!-- host component -->
    <fx:Metadata>
        [HostComponent("spark.components.ViewNavigator")]
    </fx:Metadata>

    <!-- states -->
    <s:states>
        <s:State name="landscapeAndOverlay" />
        <s:State name="portraitAndOverlay" />
        <s:State name="landscape" />
        <s:State name="portrait" />
        <s:State name="disabled" />
        <s:State name="normal" />
    </s:states>

    <s:VGroup width="100%" height="100%">
        <s:VGroup id="contentGroup" height="100%" width="100%" />
        <s:ActionBar id="actionBar" width="100%" />
    </s:VGroup>

</s:Skin>
于 2011-08-22T19:51:03.033 回答