Android: windowSoftInputMode attribute,

Source: Internet
Author: User

Android: windowSoftInputMode attribute,

Android: windowSoftInputMode

The interaction mode between the activity main window and the soft keyboard can be used to avoid the problem of blocking the input method panel. This is a new feature after Android1.5.


This attribute can affect two things:

[1] whether the keyboard is hidden or displayed when a focus is generated

[2] whether to reduce the size of the main activity window to free up space and put it on the keyboard


It must be set to a value in the following list or a "state ..." Add "adjust…" to the value ..." Value combination.

Use | to separate values. Example: <activity android: windowSoftInputMode = "stateVisible | adjustResize"/>

The value set here (except "stateUnspecified" and "adjustUnspecified") will overwrite the value set in the topic


Meanings of values:

[A] stateUnspecified: the soft keyboard status is not specified. The system selects an appropriate status or depends on the topic settings.

[B] stateUnchanged: When this activity appears, the soft keyboard will remain in the status of the previous activity, whether hidden or displayed.

[C] stateHidden: When you select activity, the keyboard is always hidden.

[D] stateAlwaysHidden: when the Activity's Main Window gets the focus, the keyboard is always hidden.

[E] stateVisible: the soft keyboard is usually visible.

[F] stateAlwaysVisible: when the activity is selected, the soft keyboard always displays the status

[G] adjustUnspecified: the default setting. It is usually determined by the system whether to hide or display it.

[H] adjustResize: This Activity always adjusts the screen size to reserve space for the soft keyboard.

[I] adjustPan: the content in the current window will be automatically moved so that the current focus is not overwritten by the keyboard and the user can always see the part of the input content.

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.