Android Navbar关闭键盘按钮名称

问题描述 投票:0回答:1

我进行了如下所示的聊天:

enter image description here

然后,当我单击EditText时,键盘将打开并通过使用以下方法隐藏bottomNavigationView

    final EditText editText = findViewById(R.id.et_Message);
    editText.setOnFocusChangeListener(new View.OnFocusChangeListener() {
        @Override
        public void onFocusChange(View v, boolean hasFocus) {
            if (!isVisibleWhileSoftKeyboardShowing(editText) && hasFocus) {
                sView.postDelayed(new Runnable() {
                    @Override
                    public void run() {
                        //sView.smoothScrollBy(0, 5000);
                        bottomNavigationView.setVisibility(View.GONE);
                    }
                }, 200);
            }
        }
    });

enter image description here

然后,当用户单击箭头以关闭键盘时:

我很喜欢它再次显示bottomNavigationView

我尝试覆盖onBackPressed(),但由于箭头的名称不同,所以它不起作用。

任何想法如何找到此箭头IsClicked

谢谢

android android-softkeyboard
1个回答
0
投票
android:windowSoftInputMode="adjustPan"
© www.soinside.com 2019 - 2024. All rights reserved.