主要用于解决软键盘弹出,遮盖登录按钮的问题,参考以下博文
https://blog.csdn.net/w372426096/article/details/52604545
对onGlobalLayout()做些修改
使用时记得传入Scrollview中最下方的那个控件
private CustomGlobalLayoutListener customGlobalLayoutListener; customGlobalLayoutListener = new CustomGlobalLayoutListener(this, scrollView, mNextBtn); scrollView.getViewTreeObserver().addOnGlobalLayoutListener(customGlobalLayoutListener);
记得修改配置文件:
android:windowSoftInputMode="stateHidden|adjustResize"