![](/img/trans.png)
[英]Flex SkinnableContainer skin access Group inside contentGroup
[英]Flex id contentGroup query
我學習Flex和練習皮膚。 所以,我只是有一個疑問:
我寫了一個自定義皮膚,名為: ApplicationContainerSkin.mxml
<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin 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:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<fx:Metadata>
[HostComponent("spark.components.Application")]
</fx:Metadata>
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Group horizontalCenter="0" verticalCenter="0">
<s:Rect left="0" right="0" top="0" bottom="0"
radiusX="10" radiusY="10">
<s:fill>
<s:SolidColor color="#CCCCCC" />
</s:fill>
</s:Rect>
<s:Group id="contentGroup"
left="30" right="30" top="30" bottom="30">
</s:Group>
</s:Group>
</s:SparkSkin>
我的懷疑:當我刪除s:Group id =“ contentGroup”時 ,我無法在我的應用程序中看到任何內容,那么為什么需要這個' contentGroup'ID ?
該ID預先指定的位置。 抱歉,如果它不是菜鳥查詢,但我很想知道它。我什至試圖檢查源代碼,但我沒有找到它,有人可以告訴我它在哪里指定,以及僅在使用了contentGroup id之后我的內容才呈現。 。? (我是說,它是如何內部工作的?)
等待您的回應!
Skinnable Spark組件指定由ID標識的“皮膚部件”。
您正在設置外觀的Application組件定義了兩個外觀部分-contentGroup和controlBarGroup,如您在此處的文檔中所見: http : //help.adobe.com/zh_CN/FlashPlatform/reference/actionscript/3/spark/components /Application.html#SkinPartSummary
Application類使用contentGroup外觀部件(如果已將其添加到外觀中)來布置內容。 可以不需要皮膚部位。 contentGroup部分不是必需的,因此當您省略它時,內容就不會顯示。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.