[Reprint] http://geyubin.iteye.com/blog/1297637
Based on the original instructions in the original document, the translation is revised to facilitate reading and understanding.
Attributes:
Android: windowsoftinputmode
How the activity interacts with the keyboard. The setting of this attribute affects two things:
Keyboard status-hide or display-When activity becomes the focus of user attention.
Activity layout adjustment-whether the activity layout is smaller to free up space for the software disk, or whether the content of the activity layout is translated when it is covered by a soft keyboard to ensure that the current focus is visible.
It must be set to a value in the following list or a "state ..." Add "Adjust…" to the value ..." Value combination.
Set multiple values in any group-multiple "states ..." Value. 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
Description:
----------------------------------------------- State prefix ----------------------------------------------------------------------
"Statehidden" when the user selects the activity, the soft keyboard is hidden, that is, when the user is sure to navigate to the activity, instead of returning it from another activity.
"Statevisible" when appropriate (that is, when you navigate to the activity main window), the soft keyboard is visible,
"Statealwaysvisible" when you select this activity, the soft keyboard is visible-that is, when the user is sure to navigate to this activity, instead of returning it from another activity.
------------------------------------------------- Adjust prefix -------------------------------------------------------------------
"Adjustunspecified" is not sure whether to adjust the size of the Main Window of the activity to leave space for the software disk. Or whether the content in the window is moved to ensure that the current focus is visible. The system automatically selects one of these modes, depending on whether the content of the window has any layout view that can scroll their content. If there is such a view, assuming that scrolling can make all the content of the window visible in a small area, the window will be adjusted. This is the default behavior settings for the main window.
Turn off the Bi soft keyboard:
Inputmethodmanager M = (inputmethodmanager) mcontext. getsystemservice (context. input_method_service );
M. hidesoftinputfromwindow (mcontentet. getwindowtoken (), 0 );