Flex 3 - 调整大小效果“问题”?

发布于 2024-10-06 19:15:57 字数 588 浏览 0 评论 0原文

我对 VBox 的调整大小事件和调整大小效果有一个小问题。

我有这样的东西:

<mx:VBox id="container"
     backgroundColor="0xFFFFFF"
     backgroundAlpha=".9"
     paddingTop="15"
     paddingLeft="15"
     paddingBottom="15"
     verticalGap="5"
     width="210"
     maxHeight="340"
     resizeEffect="{resize}"
     verticalScrollPolicy="off"
     borderStyle="solid">
.
.
.
</mx:VBox>
<mx:Resize id="resize"/>

在 vbox 内,我有一些根据用户交互折叠/展开的项目。问题是,当用户展开某个项目时,vbox 会调整大小到其最大高度,然后缩小以适合实际高度。

有谁知道如何防止它调整到最大高度并缩小到实际高度?

感谢您提供的任何帮助=)

问候。 BS_C3

I'm having a little issue with the resize event and resize effect of a VBox.

I have something like this:

<mx:VBox id="container"
     backgroundColor="0xFFFFFF"
     backgroundAlpha=".9"
     paddingTop="15"
     paddingLeft="15"
     paddingBottom="15"
     verticalGap="5"
     width="210"
     maxHeight="340"
     resizeEffect="{resize}"
     verticalScrollPolicy="off"
     borderStyle="solid">
.
.
.
</mx:VBox>
<mx:Resize id="resize"/>

Inside the vbox, I have some items that collapse/expand depending on the user interaction. The problem is that when the user expands an item, the vbox resizes to its maximum height and then shrinks to fit the actual height.

Does anyone know how prevent it from resizing to its maximum height and shrinking back to its actual height??

Thanks for any help you can provide =)

Regards.
BS_C3

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

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

发布评论

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

评论(3

是你 2024-10-13 19:15:57

从您的问题来看,设置 maxHeight 属性似乎有问题。也许尝试删除 maxHeight="340" 并替换为

resize="{if(container.height > 340) container.height = 340}"

From you question, it seems to have a problem with the maxHeight property being set. Maybe try removing maxHeight="340" and replace with

resize="{if(container.height > 340) container.height = 340}"
执手闯天涯 2024-10-13 19:15:57

或者,将 VBox 放入另一个容器中。将 VBox 高度设置为 100%,并在外部容器上调整大小。我已经使用这种类型的布局解决了许多调整大小的问题。

Alternatively, place the VBox inside another container. Set the VBox height to 100%, and do the resizing on the outter container. Ive solved loads of resizing issues using this type of layout.

苄①跕圉湢 2024-10-13 19:15:57

尝试设置回 NaN 让 Flex 弄清楚。

heightTo="{NaN}"

Try setting back to NaN to let Flex figure it out.

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