通过复制代码创建 Flex 皮肤不是一件坏事吗?

发布于 2024-12-08 13:18:44 字数 274 浏览 1 评论 0原文

我最近为各种组件创建了许多皮肤。其中一些是针对 Spark 组件的,Flash Builder 的默认行为是获取原始皮肤的源代码并复制到您的皮肤中作为起点。

通常情况下,我对原始皮肤的接受度是 90%,我只想调整或添加一点小东西。在我看来,复制 3 页源代码来做到这一点是一个坏主意。升级 Flex SDK 时该怎么办?我是否必须返回所有这些原始皮肤的来源并(重新)比较?这听起来像是一场灾难。

有没有办法可以在 MXML 中创建继承旧皮肤的新皮肤?我可以通过 ActionScript 执行此操作吗?

I've created a number of skins for various components recently. Some of these were for Spark components and the default behavior of Flash Builder is to take the source code of the original skin and copy into your skin as a starting point.

Normally, I am 90% ok with the original skin, I just want to tweak or add one little thing. It seems to me that duplicating 3 pages of source code to do this is a bad idea. What do I do when I upgrade Flex SDKs? Do I have to go back through the source of all these original skins and (re)compare? This sounds like a disaster.

Is there a way I can create a new skin in MXML that inherits from the old skin? Can I do this via ActionScript?

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

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

发布评论

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

评论(1

傲性难收 2024-12-15 13:18:45

如果你升级你的Flex SDK,我认为组件的skinParts不应该有任何修改。无论如何,如果有的话,如果您实现的皮肤部件之一的类型不正确或者您错过了所需的皮肤部件,您将会遇到编译错误。所以,如果我是你,我也不会担心:)

另一个技巧是尽可能多地使用 CSS 样式来避免此类问题。

不,我不认为你可以继承皮肤并修改它的元素(但我很高兴被证明是错误的)。

If you upgrade your Flex SDK I don't think there should be any modification in the skinParts of components. Anyway if there were, you would have a compilation error if one of your implemented skinparts is not of the right type or if you miss a required skinPart. So I wouldn't worry if I were you :)

Another tip would be to use as much as possible CSS styling to avoid this kind of problems.

And no, I don't think you can inherit from a skin and modify its elements (but I'd be glad to be proved wrong).

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