已经在视图中写了android:lines="5"
EditText 并没有显示出5行,还是1行,难道是因为布局是LInearLayout?必须是相对布局?
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:orientation="vertical" >
- <TextView
- android:id="@+id/tv_input"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/input_number"
- android:textSize="20dp" />
- <EditText
- android:id="@+id/et_input_number"
- android:singleLine="true"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:inputType="phone" />
- <TextView
- android:id="@+id/tv_input_cotent"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/input_content"
- android:textSize="20dp" />
- <EditText
- android:id="@+id/et_input_content"
- android:layout_width="match_parent"
- android:layout_height="wrap_content"
- android:inputType="text"
- android:lines="5" />
- <Button
- android:id="@+id/btn_send"
- android:layout_width="wrap_content"
- android:layout_height="wrap_content"
- android:text="@string/send_number"/>
- </LinearLayout>
复制代码 效果图:还是一行
|
|