I guess this is not possible.. but you can try..there may be a way.. but my idea is hide and show the keyboard when drawer open and close that may be possible rather than your idea..
DrawerLayout Over Keyboard
-
28-06-2023 - |
문제
I have a DrawerLayout
that I use as Sliding Menu, currently i use the InputMethodManager
to close the keyboard when the DrawerLayout
is shown
public void onDrawerOpened(View drawerView) {
supportInvalidateOptionsMenu();
// Hide Soft-Keyboard
InputMethodManager imm = (InputMethodManager) MainActivity.this.getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(drawerView.getApplicationWindowToken(), 0);
}
Is there anyway to keep the soft-keyboard open and show the DrawerLayout
on top of it? so when the drawer layout is closed, the activity/soft-keyboard is still at the same state?
Thanks.
해결책 2
다른 팁
Try this code:
((InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE)).toggleSoftInput
(InputMethodManager.SHOW_FORCED, InputMethodManager.HIDE_IMPLICIT_ONLY);
제휴하지 않습니다 StackOverflow