如您所知,Adobe 在 Flash Builder 4 中添加了一个名为 Spark 的新主题,但它对我来说看起来非常丑陋。问题是我无法将当前主题切换到 Halo!
我尝试过:
- 更改项目属性中的主题设置。没有效果 - 所有新按钮和其他控件都有这个主题
- 使用编译器设置:
-theme=${flexlib}/themes/Halo/halo.swc
- 也没有效果,与上面的故事相同
然后我注意到我的 MXML 文件中有 2 个命名空间:
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
当我将按钮声明从
切换到
时,我的按钮开始看起来好多了。但我无法手动切换所有此类声明,并且我不认为对 Application
标记进行相同的更改会在应用程序级别应用该样式。
所以,我的大问题是:如何使 Flash Builder 4 使用与 Flash Builder 3 相同的主题?如何将其应用到所有新控件?有什么我错过的技巧吗?
As you know, Adobe added a new theme called Spark in Flash Builder 4, but it looks really ugly to me. The problem is that I can't switch the current theme to Halo!
What I've tried:
- Change theme settings in project properties. No effect - all new buttons and other controls had this theme
- Use compiler settings:
-theme=${flexlib}/themes/Halo/halo.swc
- no effect also, the same story as above
Then I noticed that there are 2 namespaces in my MXML file:
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
When I switched button declaration from <s:Button>
to <mx:Button>
then my button began to look much better. But I can't switch all such declarations manually, and I don't imagine making the same change to the Application
tag would apply the style at an application level.
So, my big question: How can I make Flash Builder 4 use the same theme as in Flash Builder 3? How can I apply it to all new controls? Are there any tricks that I missed?
发布评论
评论(2)
在为 Flex 4 提供的主题中,新的 Spark 控件(s:Button 等)没有具有旧“mx”样式的皮肤。如果您想让您的 Spark 控件看起来像旧的 mx 控件,您可以需要创建自己的皮肤。正如您提到的,另一个选项是将 Spark 控件的所有实例切换到旧的 mx 对应项。缺点是您无法获得新 Spark 组件带来的任何效率。抱歉,我没有更好的消息给你。
Within the provided themes for Flex 4, there are no skins with the older "mx" styling for the new spark controls (s:Button and so on.) If you want to make your spark controls look like the old mx controls you'll need to create your own skins. The other option, as you mentioned, would be to switch all instances of the spark controls to their older mx counterparts. The downside is that you won't gain any of the efficiencies introduced with the new spark components. Sorry I don't have better news for you.
“手动”切换组件实际上可能并不那么困难。有些查找并替换将 切换为 并将
切换为
可以轻松捕获所有直接替换,并且希望您没有太多组件名称实际上不同的替换。
由于这是设置组件样式的公认方法,因此无论哪种方式,这似乎都是您最终必须要做的事情。
Switching the components "manually" might not actually be that hard. Some find and replaces switching
<s:
to<mx:
and</s:
to</mx:
would easily catch all the dropin replacements, and hopefully you don't have too many that actually differ in the component name.Since that's the accepted way to set the style of components, it seems like what you're ultimately going to have to do, one way or another.