黑马程序员技术交流社区

标题: 安卓 android:lines="5" [打印本页]

作者: mengxiang1993    时间: 2015-3-11 22:33
标题: 安卓 android:lines="5"
已经在视图中写了android:lines="5"
EditText 并没有显示出5行,还是1行,难道是因为布局是LInearLayout?必须是相对布局?
  1. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
  2.     xmlns:tools="http://schemas.android.com/tools"
  3.     android:layout_width="match_parent"
  4.     android:layout_height="match_parent"
  5.     android:orientation="vertical" >

  6.     <TextView
  7.         android:id="@+id/tv_input"
  8.         android:layout_width="wrap_content"
  9.         android:layout_height="wrap_content"
  10.         android:text="@string/input_number"
  11.         android:textSize="20dp" />

  12.     <EditText
  13.         android:id="@+id/et_input_number"
  14.         android:singleLine="true"
  15.         android:layout_width="match_parent"
  16.         android:layout_height="wrap_content"
  17.         android:inputType="phone" />

  18.     <TextView
  19.         android:id="@+id/tv_input_cotent"
  20.         android:layout_width="wrap_content"
  21.         android:layout_height="wrap_content"
  22.         android:text="@string/input_content"
  23.         android:textSize="20dp" />

  24.     <EditText
  25.         android:id="@+id/et_input_content"
  26.         android:layout_width="match_parent"
  27.         android:layout_height="wrap_content"
  28.         android:inputType="text"
  29.         android:lines="5" />
  30.     <Button
  31.         android:id="@+id/btn_send"
  32.         android:layout_width="wrap_content"
  33.         android:layout_height="wrap_content"
  34.         android:text="@string/send_number"/>

  35. </LinearLayout>
复制代码
效果图:还是一行








欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2