1, Android:windowsoftinputmode1, when the focus is generated, the soft keyboard is hidden or displayed
2. Reduce the size of the active main window to make room for the soft keyboard
2, android:imeoptions= "Actionsearch|flagnofullscreen" in the use of a edittext put into the actionbar as a function of the search box, Setting the EditText property to Android:imeoptions= "Actionsearch", you will encounter a problem, when in the horizontal screen, the width of the edittext will be filled off the screen in addition to the soft keyboard, not to match the requirements, to Android: Imeoptions= "Actionsearch|flagnofullscreen" after the OK.
3. The code sets whether the pop-up keyboard presses the window
Do not squeeze the window:
Getactivity (). GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
Squeeze window:
Getactivity (). GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE);
There are four different modes:
Soft_input_adjust_nothing
Soft_input_adjust_pan
Soft_input_adjust_resize
Soft_input_adjust_unspecified
4, sometimes unable to adjust the keyboard
Sometimes it is found that the keyboard cannot be adjusted with the following code:
Inputmethodmanager IMM = (Inputmethodmanager) getactivity (). Getsystemservice (Context.input_method_service); Imm.showsoftinput (MView, 0);
It is possible that the focus has fallen on the other non-edit frame view, and a delay may be good. When the Input method pops up, it detects if the current focus view is valid, and if the non-active focus view is not available, the input method is not ejected.
Mview.postdelayed (New Runnable () {@Overridepublic void run () {Inputmethodmanager IMM = (inputmethodmanager) getactivity (). Getsystemservice (Context.input_method_service); Imm.showsoftinput (MView, 0);}}, 100);
Android Keyboard Usage Issues summary