2011-08-22 78 views
0

默认情况下,ViewNavigator的ActionBar在最上面。我想要在底部移动。如何在Flex移动应用程序的底部获得ActionBar

navigator.actionbar.y = 415 //获取动作条在底部

但下一个视图谈到重回巅峰。您可以在每个视图中设置高度,但在返回底部之前,它会在顶部显示几秒。

回答

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> 
+0

谢谢布赖恩。它的作用像魅力。 – Ken

相关问题