如何将文本区域宽度设置为在Flex中输入的文本的长度?
发布于 2014-06-02 18:20:34
这里,我们可以根据文本的字体大小动态地计算文本区域的宽度,如下所示
protected function onChange(event:TextOperationEvent):void
{
if(textBox.width <textBox.text.length*5)
textBox.width = textBox.text.length*5;
}
<s:TextArea id="textBox" height="200" width="200" fontSize="25" change="onChange(event)" />https://stackoverflow.com/questions/13645674
复制相似问题