Astraport
Astraport

Reputation: 1257

Scale button`s icon in Flex for mobile applications

Use Flex 4.5.1 and when add icons to the button is so curve effect of scaling. Prompt how to make a proportional scaling icons?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')">

Upvotes: 0

Views: 2348

Answers (2)

Antonos
Antonos

Reputation: 573

try to create custom skin for button and do the same in commitProperties

override protected function commitProperties():void
{
      super.commitProperties();

      if(iconDisplay){
           iconDisplay.scaleMode = BitmapScaleMode.LETTERBOX;
      }
}

Upvotes: 1

Antonos
Antonos

Reputation: 573

try add creation complete handler and set btn.iconDisplay.scaleMode to 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')">

Upvotes: 0

Related Questions