Problem with IME blocking input box in Android

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.