【问题标题】:Flex Icon on Button sizing [Design]按钮大小上的 Flex 图标 [设计]
【发布时间】:2008-11-29 21:19:27
【问题描述】:

我想根据图标图像调整按钮的宽度。 我试图强制填充为 0,但没有成功。

在图块中

<mx:Button id="m1"  icon="@Embed('m1.png')"/>

查看结果

http://img513.imageshack.us/my.php?image=iconkg3.png

我怎样才能改变这个差距?

icon http://img513.imageshack.us/my.php?image=iconkg3.png

谢谢。

【问题讨论】:

    标签: apache-flex button coding-style


    【解决方案1】:

    在 creationComplete 事件上添加监听器,您可以使用此代码:

        private function OnCreationComplete(event: Event): void
        {
            if (event.target is Button)
            {
                var button: Button = (event.target as Button);
                var icon: DisplayObject = button.getChildByName("upIcon");
                if (icon) // check icon existence
                {
                    button.width = icon.width;
                    button.height = icon.height;
                }
            }
        }
    

    应该可以...

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-08-05
      • 1970-01-01
      • 1970-01-01
      • 2013-03-17
      • 1970-01-01
      • 2012-09-02
      • 1970-01-01
      • 2016-09-13
      相关资源
      最近更新 更多