【发布时间】:2013-11-14 16:58:17
【问题描述】:
我使用皮肤类创建了一个带有背景图像的应用程序。我想在应用程序的图像顶部显示一些图像。您能否建议如何在 flex 4 中执行此操作。 代码在这里:
BackGroundImageskin:-
<fx:Metadata>
[HostComponent("spark.components.supportClasses.SkinnableComponent")]
</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<s:BitmapImage source="@Embed('Img/asianwoman.jpg')" left="0" right="0" top="0" bottom="0" smooth="true"/>
主要应用:-
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Group visible="true">
<mx:Image source="Img/News1.png" visible="true" />
<s:Button label="My Button"/>
</s:Group>
这里不显示New1.png,只显示背景图片
【问题讨论】:
-
发布整个皮肤。我怀疑您将 contentGroup 放在皮肤类中的背景图像下方。
-
在 bitmapImage 之后没有,皮肤类处于关闭状态。没有添加 contentGroup。
-
你的皮肤需要一个 contentGroup 否则它不会显示任何子元素。我建议复制默认皮肤并将您的背景添加到其中。
-
对不起,我没看懂,你能解释清楚吗
标签: actionscript-3 apache-flex flex4