我想在textarea spark组件中添加垂直滚动条,即我想在textarea中显示最多5行,如果文本行将超过5,那么垂直滚动条将自动添加,如果我将减少文本行然后垂直滚动栏会自动消失。
我的textarea代码是:
<s:TextArea id="txtArea" width="{this.width}" height="3" borderVisible="false" focusAlpha="0.01"
selectionHighlighting="always" styleName="TextBox"
needsSoftKeyboard="true" focusRect="false" direction="{textBoxDirction}" buttonMode="true" useHandCursor="true" mouseChildren="true"/>
我也尝试使用verticalScrollPolicy = "on" and "off"
,但它也无效。
所以,如果有人知道如何在textarea中添加垂直滚动条,请帮我解决这个问题。
答案 0 :(得分:2)
使用
heightInLines="5"
而不是
height="3"
答案 1 :(得分:0)
只需将mx:TextArea
与width="100%"
放在mx:VBox
容器内,并保持固定高度。