问题描述

单独EditText时,可以完全铺满父控件,但是放到ScroolView后,就缩成一行了.

解决方案

在ScrollView中增加​​android:fillViewport="true"​​.

如:

<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:fillViewport="true">

<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:gravity="top"
android:inputType="textMultiLine" />

</ScrollView>