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中用以下方法设置为多行显示:

editNames.setInputType(InputType.TYPE_TEXT_FLAG_MULTI_LINE|InputType.TYPE_CLASS_TEXT);

更多相关文章

  1. android绑定服务方法使用
  2. Android学习札记18:Drawable中的setDither()方法
  3. Android 获取WIFI MAC地址的方法
  4. Android键盘自适应方法.
  5. Android的布局方法
  6. 修改android 睡眠的时间的两种方法

随机推荐

  1. android 状态栏与标题栏一体化
  2. android MAT使用
  3. android的PowerManager和PowerManager.Wa
  4. Android Webview 获取网页form 提交的数
  5. 【收藏】Android(安卓)AutoLayout全新的
  6. Android NullPointerException at androi
  7. Android开发—弹出列表、单选、多选框
  8. Android获取传感器列表
  9. Android软硬整合技术(HAL&Framework):高阶
  10. Android GPS 获得 经纬度 并得到该 坐标