在VGroup中对齐子菜单

时间:2018-10-10 06:52:56

标签: actionscript-3 flex layout

我正在尝试在Flex中建立一个非常简单的菜单/子菜单系统-您会在网站上看到的那种菜单/子菜单系统。之前,我是在纯ActionScript中完成此操作的,但是现在我正在使用Flex,因此我一直试图使子菜单向右对齐并从组的左侧扩展出来。我想防止最右边的按钮菜单从屏幕的一侧渗出。

左对齐菜单(当前,期望的行为:菜单的左侧与按钮的左侧对齐) enter image description here

右对齐菜单(当前,不希望有的行为:菜单的左侧与按钮的左侧对齐) enter image description here

右对齐菜单(预期行为:菜单的右侧与按钮的右侧对齐) enter image description here

每个“ ComboButton”对象都包含一个VGroup,其中包含按钮和菜单组件。

<s:VGroup gap="0">
    <components:BarButtonComponent id="button" />
    <components:BarButtonMenuComponent id="menu" />
</s:VGroup>

ComboButton对象重写measuredWidthmeasuredHeight以返回唯一BarButtonComponent的尺寸。我不确定如何进行此处。我尝试在菜单周围使用嵌套的HGroup并设置horizontalAlign="right",但这并没有做任何事情,因为HGroup的宽度正好成为其内部内容的宽度。

0 个答案:

没有答案