Flex 4 - TitleWindow 上的垂直布局问题

发布于 2024-12-05 08:32:38 字数 631 浏览 1 评论 0原文

这肯定是一个简单的问题,但我无法解决它。我有一个可调整大小的标题窗口。在里面我只想要一个 VGroup 来保存表单的内容,并让 HGroup 在底部有一些按钮。非常标准的东西。

<!-- Content -->
<s:VGroup id="content" height="340" width="100%">
        ...more stuff in here...
</s:VGroup>


<!-- Buttons -->
<s:HGroup id="buttonGroup" width="100%"> 
    ...buttons in here...
</s:HGroup> 

水平调整大小效果很好。但是,我希望它的行为使得当 TitleWindow 垂直调整大小时,按钮相对于 TitleWindow 保持在同一位置,并且内容 VGroup 垂直调整大小。但我不知道VGroup的高度设置为多少?

理想情况下它会是这样的:

height="{this.parent.height - buttonGroup.height - top*

或者类似的东西......

This must be a simple problem, but I can't get my head around it. I have a resizable title window. Inside I just want a VGroup to hold the contents of the form and an HGroup to have a few buttons at the bottom. Very standard stuff.

<!-- Content -->
<s:VGroup id="content" height="340" width="100%">
        ...more stuff in here...
</s:VGroup>


<!-- Buttons -->
<s:HGroup id="buttonGroup" width="100%"> 
    ...buttons in here...
</s:HGroup> 

Horizonal resizing works fine. However, I want it to behave such that when the TitleWindow is resized vertically that the buttons stay in the same place relative to the TitleWindow and the content VGroup is resized vertically. But I don't know what to set the height of the VGroup to?

Ideally it would be like this:

height="{this.parent.height - buttonGroup.height - top*

or something like that....

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

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

发布评论

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

评论(2

如梦亦如幻 2024-12-12 08:32:38

您还可以尝试以下技巧:

<s:VGroup id="layoutContainer" width="100%" height="100%">

    <s:SkinnableContainer id="content" height="100%">
        ....content here....
    </s:SkinnableContainer>

    <!-- Buttons -->
    <s:HGroup id="buttonGroup"> 
        ... buttons here...
    </s:HGroup>
</s:VGroup>

目的是使内容容器在 VGroup 内占据尽可能多的垂直空间。

让我知道这是否对你有用!

You can also try the following trick:

<s:VGroup id="layoutContainer" width="100%" height="100%">

    <s:SkinnableContainer id="content" height="100%">
        ....content here....
    </s:SkinnableContainer>

    <!-- Buttons -->
    <s:HGroup id="buttonGroup"> 
        ... buttons here...
    </s:HGroup>
</s:VGroup>

The intent is to make the content-container take as mush as possible vertical space within the VGroup.

Let me know if that worked for you!

你爱我像她 2024-12-12 08:32:38

使用约束属性。
您可以尝试 AS:

content.top = 0;  
content.bottom = buttonGroup.height;  
buttonGroup.bottom = 0;  

但最好将其放入组件的 MXML 定义中

<s:VGroup id="content" top="0" bottom="{buttonGroup.height}" width="100%">
        ...more stuff in here...
</s:VGroup>
<s:HGroup id="buttonGroup" bottom="0" width="100%"> 
    ...buttons in here...
</s:HGroup> 

如果您愿意,可以添加一些填充和边距

Use constraint properties.
You could try for AS:

content.top = 0;  
content.bottom = buttonGroup.height;  
buttonGroup.bottom = 0;  

But better put it to MXML definition of the components

<s:VGroup id="content" top="0" bottom="{buttonGroup.height}" width="100%">
        ...more stuff in here...
</s:VGroup>
<s:HGroup id="buttonGroup" bottom="0" width="100%"> 
    ...buttons in here...
</s:HGroup> 

Add some paddings and margins if you like

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