【发布时间】:2014-06-03 10:53:25
【问题描述】:
我有一个容器,它的高度可以在运行时改变。顶部有一些固定高度的项目,底部有一些固定高度的项目,我想在它们之间有一个容器来填充剩余空间。
这是我目前拥有的 mxml 的提炼。我希望 contentContainer 自动调整大小。 compA 和 compB 是实际实现中的 mxml 组件,因此它们的结构(尽管不一定是容器类型)需要保持完整。
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" width="100%">
<mx:VBox width="500" height="500" id="compA">
<mx:VBox width="100%" id="compB">
<mx:HBox width="100%">
<mx:Label text="Header" />
</mx:HBox>
<mx:VBox id="contentContainer" width="100%" height="100%">
<mx:Canvas verticalScrollPolicy="on" width="100%" height="100%">
<mx:VBox width="100%" height="100%">
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
<mx:Label text="Content" />
</mx:VBox>
</mx:Canvas>
</mx:VBox>
</mx:VBox>
<mx:HBox width="100%">
<mx:Label text="Footer" />
</mx:HBox>
</mx:VBox>
</mx:Application>
【问题讨论】:
标签: apache-flex flex3 mxml