原文:android全屏或沉浸式状态栏下输入框被软键盘遮挡解决方法
使用方法:
activity 的onCreate() 中设置
SoftHideKeyBoardUtil.assistActivity(this);
工具类:
public class SoftHideKeyBoardUtil {
public static void assistActivity(Activity activity) {
new SoftHideKeyBoardUtil(activity);
}
private View mChildOfContent;
private int usableHeightPrevious;
private FrameLayout.LayoutParams frameLayoutParams;
//为适应华为小米等手机键盘上方出现黑条或不适配
private int contentHeight;//获取setContentView本来view的高度
private boolean isfirst = true;//只用获取一次
private int statusBarHeight;//状态栏高度
private SoftHideKeyBoardUtil(Activity activity) {