adjustresize第二次进入无效,遮挡输入框
根目录增加android:fitsSystemWindows="true",并且使用自定义的根目录布局
public class MyRelativeLayout extends RelativeLayout {
public MyRelativeLayout(Context context) {
super(context);
}
public MyRelativeLayout(Context context, AttributeSet attrs) {
super(context, attrs);
}
public MyRelativeLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
//设置上边距为0
@Override
protected boolean fitSystemWindows(Rect insets) {
insets.top = 0;
return super.fitSystemWindows(insets);
}
}
声明转载参考https://blog.csdn.net/u012006926/article/details/53521198在此记录