<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>
自定義皮膚:地點火花的TabBar(+圓角朝下)
<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放在視圖堆的底部,圓角指向外部。
如果我將旋轉=「180」添加到TabBar 's:TabBar dataProvider =「{view}」skinClass =「skins.CustomSparkTabBarSkin」旋轉=「180」/>' 將使事情變得更加可笑。 我不明白爲什麼使用底部按鈕創建TabNavigator非常困難?! – Yozef 2010-11-22 01:55:44