基于美化的需要,有时候我会被要求给按钮贴上图片
下面以flex4中使用mx:Button为例:
-----------------------------------------
flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()"
width="100%" height="100%">
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.myCustomButton {
overSkin:Embed(source="styles/assets/submitBtn.gif ");
upSkin:Embed(source="styles/assets/submitBtn.gif") ;
downSkin:Embed(source="styles/assets/submitBtn.gif ");
}
width="80" height="25"/>
这里按钮禁用时图片好像是不能显示出来
下面以flex4中使用mx:Button为例:
-----------------------------------------
flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
creationComplete="init()"
width="100%" height="100%">
@namespace s "library://ns.adobe.com/flex/spark";
@namespace mx "library://ns.adobe.com/flex/mx";
.myCustomButton {
overSkin:Embed(source="styles/assets/submitBtn.gif ");
upSkin:Embed(source="styles/assets/submitBtn.gif") ;
downSkin:Embed(source="styles/assets/submitBtn.gif ");
}
width="80" height="25"/>
这里按钮禁用时图片好像是不能显示出来