Problem with IME blocking input box in Android
Everyone in the layout time, sometimes found that the input box is blocked part, can be fully displayed, but the system comes with SMS interface
can be completely floating on the soft keyboard, read the text source code, modify the input mode can be, the source is as follows
Code mode:
GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE | WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);
You can also simply point:
GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_ADJUST_PAN);
XML mode:
< Activity Android:name =". Activity.mainactivity " android:label=" @string/app_name " android: Windowsoftinputmode= "Statehidden" android:screenorientation= "Portrait" android:configchanges= "keyboardhidden|orientation"/>
Soft IME mode option:
public int softinputmode;
The following options are related to IME mode:
Whether the soft-input area is visible.
public static final int soft_input_mask_state = 0x0f;
No state was specified.
public static final int soft_input_state_unspecified = 0;
Do not modify the state of the soft input region.
public static final int soft_input_state_unchanged = 1;
Hides the input region (when the user enters the window).
public static final int soft_input_state_hidden = 2;
Hides the input region when the window receives focus.
public static final int soft_input_state_always_hidden = 3;
Displays the input region (when the user enters the window).
public static final int soft_input_state_visible = 4;
Displays the input region when the window receives focus.
public static final int soft_input_state_always_visible = 5;
The window should be actively adjusted to fit the soft input window.
public static final int soft_input_mask_adjust = 0xf0;
If no state is specified, the system attempts to select an input method style based on the contents of the window.
public static final int soft_input_adjust_unspecified = 0x00;
When the input method is displayed, the window is allowed to recalculate dimensions so that the content is not overwritten by the input method.
Cannot be mixed with soft_input_adjusp_pan; if none of the two are set, an option is automatically set according to the contents of the window.
public static final int soft_input_adjust_resize = 0x10;
The IME displays when the Panning window is displayed. It does not need to handle dimensional changes, and the framework can move the window to ensure that the input focus is visible.
Cannot be mixed with soft_input_adjust_resize; if none of the two are set, an option is automatically set according to the contents of the window.
public static final int soft_input_adjust_pan = 0x20;
When the user goes to this window, it is set automatically by the system, so you do not set it.
The flag is automatically cleared when the window is displayed.
public static final int soft_input_is_forward_navigation = 0x100;
There is always one of the options above to solve your problem:
The following configuration can solve the overlay problem in the case of nesting various layouts on my interface
<android:name= ". Activity.mainactivity " android:label=" @string/app_name " android: Windowsoftinputmode= "Adjustpan"android:screenorientation= "Portrait" />
Problem with IME blocking input box in Android