在开发中,编辑框也是常有的功能,在某个页面最下面有个EditText这时,如果弹出输入法可能会挡住输入框,导致
输入功能失效,所以为了解决这个问题,就必须让EditText 随着输入法一起移动
实现思路:
1.在EditText父类 设置android:fitsSystemWindows=“true” 属性,
fitsSystemWindows属性可以让view根据系统窗口来调整自己的布局
具体案例如下:
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"