windowSoftInputMode is an attribute in Android that defines how the activity window should adjust when the screen has focus and the soft keyboard (i.e. the on-screen keyboard) needs to be displayed. The attribute is located in the AndroidManifest.xml file and is set for each <activity> tag. windowSoftInputMode has multiple possible values, which can be divided into two categories: state-prefixed values and adjust-prefixed values.
stateUnspecified: The default state of the soft keyboard is determined by the system. stateUnchanged: The soft keyboard will remain in its last state, whether visible or hidden. stateHidden: When the Activity is created, the soft keyboard is hidden. stateAlwaysHidden: The soft keyboard is always hidden, even if the user selects a field that requires text entry. stateVisible: When the Activity is created, the soft keyboard is visible. stateAlwaysVisible: The soft keyboard is always visible.
Set in AndroidManifest.xml: Set in code: These values can be combined by separating them with the "|" symbol. In the above code, stateHidden and adjustResize are combined together. Common properties of windowSoftInputMode are adjustPan, adjustResize, adjustNothing adjustPanThe window content will not be resized, but will be translated upward so that the currently focused field is not blocked by the keyboard. The size of the Activity window (DecorView) remains unchanged. When the focused EditText is located at the bottom of the screen and the soft keyboard pops up to block the EditText, the entire DecorView will move up, but how much it will move up is uncertain. Generally, it will move up until the EditText is just not blocked by the soft keyboard. picture adjustResizeWhen the soft keyboard is displayed, the window will be resized to make room for the soft keyboard. This usually means that the content of the window will move up to make room for the keyboard. The size of the DecorView will not change, and the content area contentView (id = android.R.content) will shrink accordingly to make room for the keyboard. picture Note: adjustResize only adjusts the size of contentView, so it is still possible to cover the EditText. adjustNothingThe Activity window will not be resized and the contentView will not change size. |
What we did Business Background During the Spring...
(1). Impression volume refers to the number of ti...
Qianliao Liu Huan's height-increasing course ...
Formaldehyde, the smell of which makes people tur...
Introduction to the Encyclopedia of Cat Family Me...
In January 2025, there were 181,000 more public c...
In nature documentaries, we often see this scene:...
Recently, the "2021 Annual Report on New Tax...
This article mainly briefly introduces the backgr...
On the Internet, we should regard advertising con...
【Written at the end】 42.3 % of bipolar disorder c...
Wouldn't it be a bit magical to see the world...
The classic American TV series "Game of Thro...
The latest data released by the U.S. Centers for ...
2020 is also known as the "first year of the...