2012-09-24 38 views
1

我正在Flash Builder 4.6中構建選項卡式視圖移動應用程序,並且想要在其中登錄屏幕。Flex移動選項卡式視圖應用程序隱藏狀態中的選項卡

我有5個選項卡,並在第一個視圖頁上我有2個狀態。

1個狀態用於登錄,另一個狀態用於實際標籤本身。我可以做到這些,但想要在登錄狀態下隱藏tabbar。

我發現了一些可以通過點擊按鈕來關閉它的事情,但只要在第一個視圖頁面(登錄狀態)中將其關閉即可。

我嘗試這樣做:

<s:View xmlns:fx="http://ns.adobe.com/mxml/2009" 
     xmlns:s="library://ns.adobe.com/flex/spark" 
     textAlign="center" title="Daily Settings" 
    creationComplete="view2_creationCompleteHandler(event)"> 
    ... 
protected function view2_creationCompleteHandler(event:FlexEvent):void 
      { 
       // TODO Auto-generated method stub 
       this.tabBarVisible = false; 
      } 

但奇怪的是它只會dissapear在某些特定的時刻,而不是整個時間...

+0

我可以做到這一點與預初始化!接下來的事情是我想在其中放入一個if函數。如果(currentState == 「登錄」){ \t \t \t \t // TODO自動生成方法存根 \t \t \t \t this.tabBarVisible = FALSE; \t \t \t} \t \t \t否則{ \t \t \t this.tabBarVisible = TRUE; \t \t \t} 但這不工作大聲笑... –

回答

1

得到它在另一個線程(對不起,雙張貼...猜測編程驅使我堅果) Hide tabbar in login state flex builder

<?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" 
     currentState="login" tabBarVisible="{currentState!='login'}"> 
    <s:actionContent> 
     <s:Button includeIn="login" label="login" click="currentState='planner'"/> 
    </s:actionContent> 
    <s:states> 
     <s:State name="login"/> 
     <s:State name="planner"/> 
    </s:states> 
</s:View> 
相關問題