Android:单击按钮时将新文本行添加到 edittext
我是 Android 新手:) 我想做的是每当按下按钮时向 edittext 添加新的文本行。 例如: 您输入一个数字 (2) 按下按钮 EditText 显示“您已按 2” 当您重复使用新号码时 (3) 编辑文本将显示.. “您已输入3” “您已输入 2”
我希望它记录在编辑文本中输入的数字。
我已经完成了所有设置,当输入按钮时它会在 edittext 中显示该行,我只是不知道如何保留上一行文本,将其移动到第二行并将新行放在顶部。
谢谢你!!
I am new to Android :)
What I am trying to do is add a new line of text to edittext whenever the button is pressed.
For example:
you enter in a number (2)
Press the button
EditText displays "you have pressed 2"
when you repeat with a new number (3)
Edit Text will display..
"you have entered 3"
"you have entered 2"
I want it to make a log of the numbers entered in edittext.
I have everything set up already where it displays the line in edittext when the button is entered, I just dont know how to keep the previous line of text, move it to the 2nd line and have the new line on the top.
Thank you!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不确定它是否有效
I am not sure bt it might work