如何在 Flex 4.5 上创建一个组件?有一个 textInput ,以及它右边的一个按钮 。这个按钮有固定的大小,textInput 可以扩大直到填满父类组件的全部剩余空间。
component:
<s:HGroup>
<s:TextInput width="????"/>
<s:Button width="37" height="37" />
</s:HGroup>
我不知道如何使用 width ?我应该给 HGroup 指定一个 width 吗?
如何在 Flex 4.5 上创建一个组件?有一个 textInput ,以及它右边的一个按钮 。这个按钮有固定的大小,textInput 可以扩大直到填满父类组件的全部剩余空间。
component:
<s:HGroup>
<s:TextInput width="????"/>
<s:Button width="37" height="37" />
</s:HGroup>
我不知道如何使用 width ?我应该给 HGroup 指定一个 width 吗?
使用代码:
<fx:Script>
<![CDATA[
import spark.components.Button;
private function onCreate():void
{
var yourButton:Button = new Button();
yourButton.width = 37;
yourButton.x = 10;
yourButton.y = 100;
text.addChild(yourButton);
}
]]>
</fx:Script>
<s:TextInput borderVisible="true" id="text" height="100%" width="100%" creationComplete="onCreate()" />