您的位置:首页 > 其它

关于避免软键盘遮挡EditText显示的问题

2017-05-26 14:57 1021 查看
转载请标明处: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”


前后效果图:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: