VGroup(父级)当子级改变高度时,容器不会改变高度?
我有如下代码:
<s:VGroup gap="10" id="group" height="100%">
<s:Label text="This is page 2" />
<s:Button content="Resize Canvas" click="resize(event);"/>
<mx:Canvas id="photoCanvas" color="#567898" backgroundColor="#125567">
</mx:Canvas>
</s:VGroup>
我不明白为什么以下不起作用:
按下按钮会调整 photoCanvas 的高度(变高或变小)。由于 photoCanvas 控件是 VGroup 的子元素,容器不应该将自身更新到新的高度吗?
无论孩子们的(总)身高是多少,Vgroup 的高度始终相同!
我希望 VGroup 能够调整自身并获得等于其子级高度总和的高度值。
这不可以吗??
I have code like the following:
<s:VGroup gap="10" id="group" height="100%">
<s:Label text="This is page 2" />
<s:Button content="Resize Canvas" click="resize(event);"/>
<mx:Canvas id="photoCanvas" color="#567898" backgroundColor="#125567">
</mx:Canvas>
</s:VGroup>
I don't understand why the following does not work:
pushing the Button resizes the photoCanvas's height (gets taller or smaller). Since the photoCanvas control is a child element of the VGroup shouldn't the container update itself to the new height?
The Vgroup has ALWAYS the same height, no matter what the (total) height of the children is!
I would like the VGroup to adjust itself and get a height value equal to the sum of its children heights.
Is this not possible??
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
VGroup 已经是 100%,它不能再变大了...如果您希望它调整其子级的大小,请不要在 VGroup 中设置高度/宽度。
The VGroup is already at 100%, it can't get any larger... If you want it to resize to it's children, don't set a height/width in the VGroup.