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. |
Virtual reality (VR) technology is becoming more ...
(1). Whether the idea is good or not depends main...
Why join the WeChat Mini Program Development Comp...
Birth, aging, illness and death are the natural l...
one, Introduction In the Android development worl...
The tropical rainforest is the most species-rich ...
[[160813]] The original author, Fred Hebert, is a...
Today (23rd) 4:07 Welcome the "Great Heat&qu...
Before January 9, Zhang Xiaolong’s several rounds...
Generally speaking, data is the most authentic wa...
Perhaps, everyone has more or less fantasized abo...
How much does it cost to develop the Guyuan Garde...
You have heard the saying "eat more whole gr...
This article will help you change your taste. It ...
The winter vacation is approaching, and for pract...