设置一个EditText的最大文本行数 [英] Set maximum number of text lines for an EditText

查看:466
本文介绍了设置一个EditText的最大文本行数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以指定EditText的最大行数?我的意思是指所有的文本行,而不仅仅是可见的行(描述了the android:maxLines属性).行号不能为1,因此android:singleLine不可选择.

Is there a way of specifying the maximum numbers of lines for an EditText? By that I mean all the lines of text, not only the visible ones (as the android:maxLines attribute is described). The lines number must not be 1, so android:singleLine is not an option.

推荐答案

您可以使用:

android:singleLine="false" android:lines="5"

我不知道这是否满足您的需求.

I don't know if that does what you need.

这篇关于设置一个EditText的最大文本行数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆