我进行了如下所示的聊天:
然后,当我单击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);
}
}
});
然后,当用户单击箭头以关闭键盘时:
我很喜欢它再次显示bottomNavigationView
。
我尝试覆盖onBackPressed()
,但由于箭头的名称不同,所以它不起作用。
任何想法如何找到此箭头IsClicked
?
谢谢
android:windowSoftInputMode="adjustPan"