2011-08-22 40 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

相關問題