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 ViewFlipper
  2. Android在Button按钮上同时显示文字和图片
  3. android核心技术之性能分析工具Systrace
  4. ANDROID视图空间代码
  5. android的ListView显示
  6. Android(安卓)EditView属性详细介绍
  7. android EditText彻底搞定输入框隐藏/显示背景 可编辑输入问题
  8. 【Android】注解框架(二)-- 基础知识(Java注解)& 运行时注解框架
  9. Android之Adapter用法总结

随机推荐

  1. Android知识搜罗
  2. Android从SD卡中加载图片或读取信息
  3. table 标签使用
  4. 表单,后台,元素样式的实例演示
  5. 登录表单+iframe后台架构+css优先级
  6. HTML图片列表及表格制作课程表
  7. 1. 写一个登录表单,要求有邮箱,密码,登录
  8. HTML登录表单的实现
  9. 一个简单的登陆表单、后台框架及实例演示
  10. 表格/图片/链接/列表