Android设置文本框单行多行显示

来源:互联网 发布:人民银行软件中心待遇 编辑:程序博客网 时间:2024/06/06 06:44

android:singleLine

Since: API Level

Constrains the text to a single horizontally scrolling line instead of letting it wrap onto multiple lines, and advances focus instead of inserting a newline when you press the enter key. Note: for editable text views, it is better to control this using the textMultiLine flag in the inputType attribute. (If both singleLine and inputType are supplied, the inputType flags will override the value of singleLine.)

从单行变为显示多行时,根据api说明,最好用android:inputType="textMultiLine "来设置。

在java中用以下方法设置为多行显示:

原创粉丝点击