转载请标明处:http://blog.csdn.net/chaoyangsun/article/details/72770080
不废话,直接上代码:
<ScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content">
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@null"
android:windowSoftInputMode="adjustResize"
android:minHeight="100dp"
/>
</ScrollView>
这里有三个关键点:
1、EditText外层加一个ScrollView
2、EditText的背景设置为“@null”
3、EditText属性windowSoftInputMode设置为“adjustResize”
前后效果图: