如何在 Flex 3 中更改盒子组件的方向?

发布于 2024-08-04 07:11:39 字数 234 浏览 3 评论 0原文

使用 mx:Box 我可以将方向设置为“水平”或“垂直”。不过,我想颠倒盒子中组件的顺序。例如:

之前:

|button1| |按钮2| |按钮3|

之后:

|button3| |按钮2| |按钮1|

我创建了一个位于 mx:Box 中的自定义组件,并希望以尽可能简单的方式来完成此操作。

感谢任何帮助,

非常感谢,

布林

With mx:Box I can set the direction to be either "horizontal" or "vertical". I'd like to reverse the order of the components in the box though. For example:

before:

|button1| |button2| |button3|

after:

|button3| |button2| |button1|

I've created a custom component that lives in a mx:Box and would like to do this in as simplest a way as possible.

Any help appreciated,

Many thanks,

Bryn

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吻安 2024-08-11 07:11:39

我想到的最简单的方法是重写 Box 中的 addChild 方法:

import mx.containers.Box;

public class ReverseBox extends Box
{
  public override function addChild(child:flash.display.DisplayObject):flash.display.DisplayObject
  {
    return addChildAt(child, 0);
  }
}

hth

Koen

The simplest that comes to mind is to override the addChild method in Box:

import mx.containers.Box;

public class ReverseBox extends Box
{
  public override function addChild(child:flash.display.DisplayObject):flash.display.DisplayObject
  {
    return addChildAt(child, 0);
  }
}

hth

Koen

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文