我正在阅读 TourDeFlex(Button With Icon) 中的示例源代码,我发现很难理解皮肤层。
参见TDFPanelSkin.mxml的代码:
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
<s:State name="normalWithControlBar" />
<s:State name="disabledWithControlBar" />
</s:states>
<!-- drop shadow -->
<s:RectangularDropShadow id="shadow" blurX="20" blurY="20" alpha="0.32" distance="11"
angle="90" color="#000000" left="0" top="0" right="0" bottom="0"/>
<!-- layer 1: border -->
<s:Rect left="0" right="0" top="0" bottom="0">
<s:stroke>
<s:SolidColorStroke color="0" alpha="0.50" weight="1" />
</s:stroke>
</s:Rect>
<!-- layer 2: background fill -->
<!-- This layer was modified for Tour de Flex samples to have a gradient border at the bottom. -->
<s:Rect left="0" right="0" bottom="0" height="15">
<s:fill>
<s:LinearGradient rotation="90">
<s:GradientEntry color="0xE2E2E2" />
<s:GradientEntry color="0x000000" />
</s:LinearGradient>
</s:fill>
</s:Rect>
您可以在评论中看到,有“layer 1”和“layer 2”。
只是一个面板,为什么会有层?一个组件可以有多少层?哪里知道一个层应该有什么?