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(安卓)ExpandableListView同时显示多种不同类型字列表
  2. 直播软件源码android ui LinearLayout中按扭平行显示
  3. Android使用AchartEngine绘制曲线图
  4. android > WebView > 布局
  5. [置顶] Android(安卓)百度地图 简单实现--- 美食搜索
  6. Android(安卓)ListView 几个重要属性
  7. CheckedTextView 显示问题
  8. android ImageView scaleType属性
  9. scrollView嵌套recyclerView 显示不全

随机推荐

  1. Android(安卓)获取 IP 地址
  2. android 动态渐变 字符效果
  3. android开发环境_反编译
  4. ScrollNumber 数字滚动
  5. Android(安卓)Q&A | setOnItemClickListe
  6. Android(安卓)为CheckBoxPreference Pref
  7. android 几个快速编译image的指令
  8. Android滚动文字效果
  9. android > 广播监听电话状态
  10. android --- 2g/3g流量问题实例