我的應用程序中的用戶界面使用了大量的按鈕,這些按鈕大部分都是減去他們皮膚中使用的FXG圖形。他們的皮膚看起來像這樣使用FXG圖形的按鈕外觀模板?
<?xml version="1.0" encoding="utf-8"?>
<s:Skin xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:ai="http://ns.adobe.com/ai/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt" xmlns:flm="http://ns.adobe.com/flame/2008" xmlns:graphics="assets.graphics.*" xmlns:ATE="http://ns.adobe.com/ate/2009">
<fx:Metadata>[HostComponent("spark.components.Button")]</fx:Metadata>
<s:states>
<s:State name="up"/>
<s:State name="over"/>
<s:State name="down"/>
<s:State name="disabled"/>
</s:states>
<graphics:RectangleGraphic bottom="0"/>
<graphics:ButtonTextGraphic alpha.disabled="0.45" x="22" y="6"/>
<graphics:ButtonSymbolGraphic alpha.disabled="0.45" x="4" y="4">
<graphics:filters>
<s:GlowFilter includeIn="over, down" blurX="3" blurY="3" inner="false" color="#3F5F93" strength="2" alpha="1.0" quality="2" knockout="false"/>
<s:GlowFilter includeIn="down" blurX="3" blurY="3" inner="false" color="0x5380d0" strength="2" alpha="1.0" quality="2" knockout="false"/>
</graphics:filters>
</graphics:ButtonSymbolGraphic>
<graphics:SmallButtonLineSeparatorGraphic bottom="-0.5"/>
</s:Skin>
其中RectangleGraphic和SmallButtonLineSeparatorGraphic是跨所有按鈕使用FXGs和ButtonTextGraphic和ButtonSymbolGraphic是FXGs特定於每個按鈕。 我很想擁有一個模板皮膚,它爲每個按鈕提供了兩個特定的FXG,但我不確定如何做到最好。
絕妙的回答!謝謝。 – 2011-06-05 01:01:43
很高興幫助! – JeffryHouser 2011-06-05 02:03:19