在Flex中的缩放按钮`s图标为移动应用程序

时间:2012-01-27 20:51:28

标签: flex mobile air icons flash-builder

使用Flex 4.5.1并在向按钮添加图标时进行缩放的曲线效果。 提示如何制作比例缩放图标?No aspect ratio icon

<s:Button width="100%" height="50" label="Create new map" click="button3_clickHandler(event)"
              fontSize="22" icon="@Embed('icons/001-folder.png')">

2 个答案:

答案 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')">