1 Reply Latest reply on Oct 15, 2011 12:53 PM by Shongrunden

    mx:TabBar is better than s:TabBar

    hidarikani Level 2

      s:TabBar is a downgrade because it doesn't support disabled tabs.

      Here's an example:

       

       

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" 
                     xmlns:s="library://ns.adobe.com/flex/spark" 
                     xmlns:mx="library://ns.adobe.com/flex/mx">
          
          <s:controlBarContent>
              <s:CheckBox id="tab1Enabled"
                          label="Tab1.enabled"
                          selected="true"/>
              
              <s:CheckBox id="tab2Enabled"
                          label="Tab2.enabled"
                          selected="false"/>
          </s:controlBarContent>
      
      
          <mx:VBox verticalGap="0"
                   verticalCenter="0"
                   horizontalCenter="0">
              <mx:TabBar dataProvider="{viewStack}"/>
              <s:TabBar  dataProvider="{viewStack}"/>
              <mx:ViewStack id="viewStack"
                            width="200"
                            height="100">
                  <s:NavigatorContent id="tab1"
                                      label="Tab1"
                                      enabled="{tab1Enabled.selected}"
                                      backgroundColor="red">
                      <s:Label text="Label 1" />
                  </s:NavigatorContent>
                  <s:NavigatorContent id="tab2"
                                      label="Tab2"
                                      enabled="{tab2Enabled.selected}"
                                      backgroundColor="blue">
                      <s:Label text="Label 2" />
                  </s:NavigatorContent>
              </mx:ViewStack>
          </mx:VBox>
      </s:Application>