EditText自动转到新行 [英] EditText automatically go to a new line
本文介绍了EditText自动转到新行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想使用最大行数为2和最大长度为20的EditText
,如果EditText
长度大于10,则它应自动转到新行,因此用户无需按进入.有人可以帮我这个要求吗?
I want to make the EditText
with max lines of 2 and max length of 20. If the EditText
length is more than 10, it should automatically go to a new line so the user don't need to press Enter. Can someone help me with this requirement?
推荐答案
将其添加到您的EditText xml代码中
android:inputType ="textMultiLine"
android:inputType="textMultiLine"
这将在输入数据时自动将文本移到下一行.
This will automatically moves your text to next line while entering data.
这篇关于EditText自动转到新行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文