Flex-4 Beta2:背景图像停止工作

发布于 2024-08-08 14:33:44 字数 460 浏览 5 评论 0原文

将项目从 Flex4 Beta1 升级到 Beta2 后,我发现 Halo 组件不再支持背景图像样式。

例如:

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
         backgroundImage="@Embed(source='myImage.png')" />

请注意,jira 问题 SDK-23050 指出了以下内容:

Spark 皮肤不支持backgroundImage。

但这并没有使用 Spark 皮肤,只是一个标准的 Halo 组件。

有人有什么想法吗?

After upgrading a project from Flex4 Beta1 to Beta2, I've found that the background-image style is no longer supported on Halo components.

Eg:

<mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml"
         backgroundImage="@Embed(source='myImage.png')" />

Note that jira issue SDK-23050 points out the following :

backgroundImage is not supported for Spark skins.

But this is not using a Spark skin, just a standard Halo component.

Anyone got any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

是你 2024-08-15 14:33:44
<s:BorderContainer x="100" y="100" width="200" height="200"

                   backgroundImage="@Embed(source='image.jpg)" >
</s:BorderContainer>

使用上面的代码。任何spark:BorderContainer都有backgroundImage选项,或者其他backgroundImage选项。将您想要的图像添加到源中,并为 image.jpg 添加您的图像名称及其扩展名。不要忘记单引号。

<s:BorderContainer x="100" y="100" width="200" height="200"

                   backgroundImage="@Embed(source='image.jpg)" >
</s:BorderContainer>

Use the code above. Any spark:BorderContainer have the option backgroundImage, either other backgroundImage options. Add the image you want to your source and put for image.jpg your image's name with its extension. do not forget single quotation marks.

岁吢 2024-08-15 14:33:44

您现在必须创建一个皮肤类。使用 VGroup 并指定定制皮肤。

You have to create a skin class now. Use a VGroup and specify a custom made skin.

聽兲甴掵 2024-08-15 14:33:44

Flex 4 中的 MX 组件允许您使用 Spark 外观,并且 Adob​​e 默认情况下使用 Spark 外观,以便同一应用程序中的 MX 和 Spark 组件看起来像是属于同一组。显然,Spark 皮肤支持与 Halo 皮肤不同的功能,现在如果您希望皮肤看起来不同(除了一些简单的颜色样式),您需要调整皮肤。考虑到设计师的创造力,这是一种比仅使用 CSS 更好的方法,因为它更加灵活,但它让熟悉 Flex 3 工作流程的人感到惊讶。

复制默认皮肤并为其添加背景并不难。然而,如果您愿意的话,您还应该能够使用旧的 Halo 皮肤来获得背景图像支持。我相信您想告诉您的 VBox 使用 mx.skins.halo.HaloBorder。

MX components in Flex 4 allow you to use Spark skins, and Adobe uses Spark skins by default so that MX and Spark components in the same application look like they belong together. Obviously, Spark skins support different functionality than Halo skins, and now you're expected to tweak the skins if you want them to look different (except for some simple color styles). Considering how creative designers can be, this is a much better approach than using only CSS because it's way more flexible, but it catches people familiar with the Flex 3 workflow by surprise.

It's not too hard to copy the default skin and add a background to it. However, you should also be able to use the old Halo skin to get the backgroundImage support, if that's what you prefer. I believe you want to tell your VBox to use mx.skins.halo.HaloBorder.

放我走吧 2024-08-15 14:33:44

我最终将backgroundImage更改为backgroundSkin,这解决了问题。

I ended up changing backgroundImage to backgroundSkin, and that solved the problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文