0
<s:VGroup horizontalAlign="center" horizontalCenter="0" verticalCenter="0" gap="0">
    <mx:ViewStack id="view" width="450" height="300" />
    <!-- NavigatorContent dynamically gets added to view on appComplete-->
    <s:TabBar dataProvider="{view}" skinClass="skins.CustomSparkTabBarSkin" />
</s:VGroup>

カスタムスキン:

<s:Skin 
xmlns:fx="http://ns.adobe.com/mxml/2009" 
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009"     
alpha.disabled="0.5"><fx:Metadata>
    <![CDATA[ 
    [HostComponent("spark.components.TabBar")]
    ]]>
</fx:Metadata> 

<fx:Script  fb:purpose="styling" >
    <![CDATA[ 

    import mx.core.UIComponent;

    /**  Push the cornerRadius style to the item renderers.*/
    override protected function updateDisplayList(unscaledWidth:Number, unscaleHeight:Number):void {
        const numElements:int = dataGroup.numElements;
        const cornerRadius:int = hostComponent.getStyle("cornerRadius");

        for (var i:int = 0; i < numElements; i++) {
            var elt:UIComponent = dataGroup.getElementAt(i) as UIComponent;
            if (elt)
                elt.setStyle("cornerRadius", cornerRadius);
        }
        super.updateDisplayList(unscaledWidth, unscaledHeight);
    }

    ]]>            
</fx:Script>
<s:states>
    <s:State name="normal" />
    <s:State name="disabled" />
</s:states>
<!--- @copy spark.components.SkinnableDataContainer#dataGroup -->
<s:DataGroup id="dataGroup" width="100%" height="100%">


次のようになります: http://yozef.com/files/tabExample.png

その TabBar をビュースタックの下部に配置し、角を丸くして外側に向けたいと思います。

4

1 に答える 1

0

ゼロから始める...デザインモードで...アウトラインビューのタブバーをクリックし、プロパティビューでスキンの横にあるドロップダウンをクリックして[スキンの作成...]を選択します。ソースビューに切り替えてButtonBarButtonを見つけ、回転を追加します。 = "180" to it ...(これはほぼ必要なものですが、テキストは上下逆になります)デザインビュー(TabBarカスタムスキン上)に戻り、アウトラインビューでButtonBarButtonをクリックし、プロパティビューでクリックします。 [スキン]の横のドロップダウンで[スキンの作成...]を選択します。アウトラインビューでlabelDisplayを見つけて、rotation="180"を追加します。

これは、あなたが探しているものを達成するために私が考えることができる最速の方法です。テキストが希望する場所に正確にない場合は、カスタムButtonBarButtonスキンの他の値を微調整したい場合があります...

于 2010-11-22T03:11:44.750 に答える