flex 图片自适应

    技术2026-01-22  9

     让图片始终保持在100%显示效果 最初代码为 

    <mx:Image id="mySelf" width="46" height="44" y="6" left="7" source="@Embed('images/14.gif')" toolTip="用户头像" autoLoad="true" />

    修改后

    <mx:Canvas width="46" height="44" y="6" left="7"> <mx:Image id="mySelf" width="100%" height="100%" source="@Embed('images/14.gif')" toolTip="用户头像" autoLoad="true" maintainAspectRatio="false"/> </mx:Canvas>

    autoLoad     maintainAspectRatio

    最新回复(0)