Apache flex FillColor样式似乎不适用于按钮
我使用mx.controls.Button控件并尝试更改其颜色:Apache flex FillColor样式似乎不适用于按钮,apache-flex,actionscript-3,Apache Flex,Actionscript 3,我使用mx.controls.Button控件并尝试更改其颜色: import mx.controls.Button; //... var myButton:Button = new Button(); myButton.width = 70; myButton.height = 30; myButton.label = 'test'; myButton.setStyle('fillColors', [0x0f9f4f, 0x0f9f4f, 0x006600, 0x006633]); add
import mx.controls.Button;
//...
var myButton:Button = new Button();
myButton.width = 70;
myButton.height = 30;
myButton.label = 'test';
myButton.setStyle('fillColors', [0x0f9f4f, 0x0f9f4f, 0x006600, 0x006633]);
addChild(myButton);
但它不起作用。然而,这种风格和其他许多风格都能很好地发挥作用。
如何更改按钮的颜色
怎么了?如何设置按钮的颜色?FillColor采用两个参数,而不是四个参数 例如:
setStyle('fillColors',[0x000000,0xFFFFFF])
你也在试着设置fillAlpha吗
http://livedocs.adobe.com/flex/3/html/help.html?content=skinning_8.html更改为2个参数。仍然不起作用。fillAlphas不起作用。请尝试先添加按钮,然后调用setStyle方法。