首先你需要做的是創建一個自定義皮膚類。在FlashBuilder(FB)中,有一個選項可以自動創建一個,但本質上它只是一個類。
在FB,在項目中的某處單擊鼠標右鍵,選擇 '新建> MXML皮膚'
![enter image description here](https://i.stack.imgur.com/q1AXp.jpg)
然後在嚮導表格如下:
![enter image description here](https://i.stack.imgur.com/Uzta0.jpg)
否則只需創建一個新的.mxml文件並將spark.skins.spark.ApplicationSkin
中的代碼複製/粘貼到其中即可。
然後在您的應用程序分配給你剛剛創建的外觀類:
<s:Application ... skinClass="skins.MyApplicationSkin" />
現在,讓我們編輯新建的外觀類。這是你感興趣的部分(我會剪掉一些部分,使其更清晰):
<s:Group left="0" right="0" top="0" bottom="0">
<s:layout>
<s:VerticalLayout gap="0" horizontalAlign="justify" />
</s:layout>
<s:Group id="topGroup" minWidth="0" minHeight="0"
includeIn="normalWithControlBar, disabledWithControlBar" >
<!-- some graphic elements here -->
<s:Group id="controlBarGroup" left="0" right="0" top="1" bottom="1" ...>
<s:layout>
<s:HorizontalLayout ... />
</s:layout>
</s:Group>
</s:Group>
<s:Group id="contentGroup" width="100%" height="100%" ... />
</s:Group>
幾乎在那裏。現在我們需要做的就是在'contentGroup'下面移動'topGroup'。 'topGroup'包含一些圖形+ controlBarGroup。 'contentGroup'是所有組件將被插入的地方,但在你的應用程序.mxml文件中。
<s:Group left="0" right="0" top="0" bottom="0">
<s:layout>
<s:VerticalLayout gap="0" horizontalAlign="justify" />
</s:layout>
<s:Group id="contentGroup" width="100%" height="100%" ... />
<s:Group id="topGroup" minWidth="0" minHeight="0"
includeIn="normalWithControlBar, disabledWithControlBar" >
<!-- some graphic elements here -->
<s:Group id="controlBarGroup" left="0" right="0" top="1" bottom="1" ...>
<s:layout>
<s:HorizontalLayout ... />
</s:layout>
</s:Group>
</s:Group>
</s:Group>
謝謝你的好解釋,這個作品!我甚至通過修改「backgroundRect」將背景填充更改爲漸變。 –