1
這是我的XML文件,它定義了兩個EditText
組件和兩個TextView
成分,但是當第二EditText
組件下面的EditText的Android TextView的消失
android:inputType="textMultiLine"
填滿整個屏幕,這兩個TextView
成分就會消失,爲什麼是這樣?
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<EditText
android:id="@+id/note_title"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginRight="16dp"
android:layout_marginTop="16dp"
android:hint="@string/title_hint"
android:textStyle="bold"
android:textSize="20sp"
android:textColorHint="@color/titleColorHint"
android:textColor="@color/colorText"
android:inputType="text"
android:background="@null"/>
<EditText
android:id="@+id/note_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginRight="16dp"
android:layout_marginTop="10dp"
android:hint="@string/text_hint"
android:layout_below="@id/note_title"
android:textSize="16sp"
android:textColorHint="@color/textColorHint"
android:textColor="@color/colorText"
android:inputType="textMultiLine"
android:background="@null"/>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="22dp"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:text="@string/dotted_line"
android:textSize="11sp"
android:textColor="@color/dottedLineColor"/>
<TextView
android:id="@+id/note_date"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginTop="20dp"
android:layout_gravity="bottom|end"
android:text="Note date"
android:textColor="@color/dateTextColor"
android:textSize="11sp"/>
</LinearLayout>
你需要修復的高度,如果多行編輯文本,或使父滾動視圖,使屏幕滾動。 TextViews被推到屏幕下方。 – drulabs
謝謝。我已經嘗試了下面的答案。 –