使用Flex 4.5.1并在向按钮添加图标时进行缩放的曲线效果。 提示如何制作比例缩放图标?
<s:Button width="100%" height="50" label="Create new map" click="button3_clickHandler(event)"
fontSize="22" icon="@Embed('icons/001-folder.png')">
答案 0 :(得分:1)
尝试为按钮创建自定义外观并在commitProperties
中执行相同操作override protected function commitProperties():void
{
super.commitProperties();
if(iconDisplay){
iconDisplay.scaleMode = BitmapScaleMode.LETTERBOX;
}
}
答案 1 :(得分:0)
尝试添加创建完成处理程序并将btn.iconDisplay.scaleMode设置为BitmapScaleMode.LETTERBOX
protected function creationCompleteHandler(event:FlexEvent):void
{
btn.iconDisplay.scaleMode = BitmapScaleMode.LETTERBOX
}
<s:Button id="btn" creationComplete="creationCompleteHandler(event)" width="100%" height="50" label="Create new map" click="button3_clickHandler(event)"
fontSize="22" icon="@Embed('icons/001-folder.png')">