android EditText 单行显示并且设置imeOptions很简单,条件是在xml中将singleLine设置为true,但是文本框需要多行时,imeOptions默认会无效。
解决方案
xml设置
android:imeOptions="actionDone"
android:inputType="text"
代码设置
editText.setHorizontallyScrolling(false)
editText.maxLines = Integer.MAX_VALUE
android EditText 单行显示并且设置imeOptions很简单,条件是在xml中将singleLine设置为true,但是文本框需要多行时,imeOptions默认会无效。
xml设置
android:imeOptions="actionDone"
android:inputType="text"
代码设置
editText.setHorizontallyScrolling(false)
editText.maxLines = Integer.MAX_VALUE
本文标题:Android EditText支持imeOptions且多行显
本文链接:https://www.haomeiwen.com/subject/iguibdtx.html
网友评论