考虑以下mx:TextArea ..
<mx:TextArea id="textArea"/>
Run Code Online (Sandbox Code Playgroud)
..使用..定期更新新的文本行
textArea.text += newLineBeingAdded + "\n";
Run Code Online (Sandbox Code Playgroud)
..如何确保textarea向下滚动到底部,以便添加的最后一行对用户可见?
添加文本集后
callLater(scrollToEnd);
....
function scrollToEnd():void {
textArea.verticalScrollPosition = int.MAX_VALUE;
}
Run Code Online (Sandbox Code Playgroud)
它应该滚动到最后.
甚至比callLater更好的是使用invalidateProperties/ commitProperties.
| 归档时间: |
|
| 查看次数: |
3197 次 |
| 最近记录: |