美文网首页
Android EditText支持imeOptions且多行显

Android EditText支持imeOptions且多行显

作者: Android出海 | 来源:发表于2023-10-09 14:13 被阅读0次

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