设置软键盘模式为SOFT_INPUT_ADJUST_PAN,但是这个只能在常规activity下正常,dialog默认还是会顶上去的,可以强制设置dialog的window高度为屏幕高度
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setTitle(null);
getWindow().setBackgroundDrawable(new ColorDrawable(Color.TRANSPARENT));
getWindow().setLayout(WindowManager.LayoutParams.MATCH_PARENT, SystemInfo.getWindowHeight(this));
getWindow().setGravity(Gravity.BOTTOM);
getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
setContentView(getLayoutId());
}