如何使动态文本框下推其他控件
这是一个非常简单的问题,我认为很容易在谷歌上找到,但我想不出术语。
我正在使用 CS4 和 AS3,并在彼此下方放置一些多行动态文本框。当我填充顶部文本框时,我希望当内容流到额外的行时它会自动下推其下方的其他文本框。
目前,它仅环绕到每个文本框之间的间隙,但在到达下面的文本框时停止。
是否有一个属性允许这样做(我在 Silverlight 中工作过,并且那里有控件),我可以设置它,或者我必须手动实现它并调用功能以在每次我时重新设置所有控件 y 属性更改文本框中的文本?
谢谢
This is a really easy one that I thought would be easily found on google but I can't think of the terminology.
I'm using CS4 and AS3 with a few multi-line dynamic text boxes beneath one another. When I populate the top text box I would like it to automatically push down the other text boxes beneath it when the content flows on to extra lines.
At the moment it only wraps to the gap that is between each text box but then stops when reaching the text box beneath.
Is there a property to allow for this (I've worked in Silverlight and there was on controls there) that I can just set or will I have to manually implement this and call functionality to re-set all the controls y properties each time I change the text in the text box?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
首先,您需要自动调整文本字段的大小
,然后需要监听文本字段的更改,或者用户
根据新的高度在其中输入内容,您可以向上或向下移动其下方的其他元素
first you need the textfield to be autosized
then you need to listen to the textfield changes, or the user typing in it
based on the new height you can move the other elements under it up or down
我不知道有任何属性可以轻松做到这一点,但我已经手动实现了类似的东西。每当您想要调整文本字段时,请调用与此类似的函数:
(未经测试的代码)
I'm not aware of any property to easily do this, but I have manually implemented something similar. Whenever you want to adjust your textFields call a function similar to this:
(untested code)