2

如果我在 Flex3 中有一个按钮

<mx:Button label="Testing" cornerradius='5'/>

我想把它改成 Flex4

<s:Button label="Testing" styleName="buttonStyle"/>
<fx:Style>
    .buttonStyle{
    corner-radius:5;
    font-weight:bold;
}
</fx:Style>

我还需要什么才能使 Flex 4 按钮看起来与 Flex 3 按钮完全一样?

我现在可以看到的是 1. 鼠标悬停在按钮上的渐变非常不同。2. Flex4 按钮的边框与 Flex3 不同。

我如何解决这两个条件,还有更多的区别吗?

4

2 回答 2

6

如果您使用光环主题会发生什么?

http://help.adobe.com/en_US/flex/using/WS2db454920e96a9e51e63e3d11c0bf69084-7f85.html

http://blog.flexexamples.com/2009/07/14/using-the-halo-theme-in-flex-4/

基本上,设置这个编译器参数:

-theme=${flexlib}/themes/Halo/halo.swc
于 2011-06-03T00:02:45.637 回答
1

这可以通过为按钮创建自定义外观来轻松完成。

<s:Button label="Testing" skinClass="com.myApp.Flex3ButtonSkin"/>

And inside the Skin class, modify the mxml objects within to make it look like the Flex 3 Button. With skin classes you can make the buttons and any other component look like anything.

于 2011-06-03T22:08:15.930 回答