How can I set the Flex TextInput component to have 100% width, so that it has width fill up the parent width space? I tried with <s:TextInput id="myid" width="100%"/>
but didn't work.
Thank you.
How can I set the Flex TextInput component to have 100% width, so that it has width fill up the parent width space? I tried with <s:TextInput id="myid" width="100%"/>
but didn't work.
Thank you.
You can try to bind to parent width by using
<s:TextInput id="myid" width="{width}"/>
In such situations I usually set different background colors to component so I can see where the problem is. In flex 3 I do it just with setting backgroundColor property, in flex 4 I use rectangle:
<s:Rect height="{height}"
width="{width}"
includeInLayout="false">
<s:fill>
<s:SolidColor color="{Math.random() * 0xffffff}"/>
</s:fill>
</s:Rect>
If you still have a problem, maybe post your parent code.
What you posted is correct. Most likely something is causing the TextInput's parent container to be smaller than you think. Try setting some explicit width(s) on the container(s) along with either visible borders or background colors so you can see what's going on. It's hard to just guess without any context.