软键盘弹出将布局顶上去

软键盘弹出将底部布局顶上去:

android:windowSoftInputMode="adjustResize"

软键盘弹出不让底部布局顶上去:

android:windowSoftInputMode="adjustPan"

 

如果上面不行的话,添加软键盘监听:

    private void setSoftKeyBoardListener() {
        SoftKeyBoardListener softKeyBoardListener = new SoftKeyBoardListener(this);
        //软键盘状态监听
        softKeyBoardListener.setListener(new SoftKeyBoardListener.OnSoftKeyBoardChangeListener() {
            @Override
            public void keyBoardShow(int height) {
                //当软键盘显示的时候
                rl_bottom.setVisibility(View.VISIBLE);
            }

            @Override
            public void keyBoardHide(int height) {
                //当软键盘隐藏的时候
                rl_bottom.setVisibility(View.GONE);
            }
        });
    }

SoftKeyBoardListener 的内容为:https://blog.csdn.net/wuqingsen1/article/details/84760820

你可能感兴趣的:(控件的基本设置)