SLaks 2013-06-04 07:56 采纳率: 0%
浏览 1870

在 Flex 4.5 上用 textEdit 填充宽度

如何在 Flex 4.5 上创建一个组件?有一个 textInput ,以及它右边的一个按钮 。这个按钮有固定的大小,textInput 可以扩大直到填满父类组件的全部剩余空间。
component:

<s:HGroup>
    <s:TextInput width="????"/>
    <s:Button width="37" height="37" />
</s:HGroup>

我不知道如何使用 width ?我应该给 HGroup 指定一个 width 吗?

  • 写回答

2条回答 默认 最新

  • yongyong_21 2013-06-04 09:11
    关注

    使用代码:

    <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()" />
    
    评论

报告相同问题?