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. |
How to make an English check-in mini program? How...
Popular products cannot be copied, but the logic ...
Businesses often decide to hire an SEO company in...
On October 28, the Wuyun vulnerability platform r...
Tmall Double Eleven 2017 is coming soon. During t...
Recently, a kind of "dry choking yogurt"...
From the perspective of event operation and user ...
This article is reprinted from the WeChat public ...
At the beginning of 2015, Zhang Chaoyang, who ret...
On the banks of the great river, there are relics...
Weibo, WeChat, H5, offline activities ... If you a...
When it comes to auto show advertising, experienc...
Earlier this year, Dan Check, vice president of t...
Introduction to the latest course of postpartum r...
In the long river of time, the encounter between ...