我正在创建一个组件,我想根据它的内容设置它的高度。当我这样写:
<s:SkinnablePopUpContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
backgroundAlpha="0"
height="{content.height}">
这是必须的,但是当我想让我的组件的高度比这个内容的高度多一点:
<s:SkinnablePopUpContainer xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
backgroundAlpha="0"
height="{content.height * 3/2}">
我的组件的高度变得像“3571428.5714285714”一样疯狂。但是当我这样做时:
height="{content.height * 2/3}"
只是让它的高度稍微降低并且正常工作。
当我在creationComplete事件中执行它时,它仍然正常工作:
protected function creationCompleteHandler(event:FlexEvent):void
{
this.height = content.height * 3/2;
}
我想知道我做错了什么。 谢谢你的帮助