Use the android: windowSoftInputMode attribute in the AndroidManifest. xml file | keyboard, squeezing, layout

Source: Internet
Author: User

Turn: http://www.blogjava.net/sterning/archive/2010/12/30/342005.html

 

The AndroidManifest. xml File

<Activity android: windowSoftInputMode = ["stateUnspecified ",

"StateUnchanged", "stateHidden ",

"StateAlwaysHidden", "stateVisible ",

"StateAlwaysVisible", "adjustUnspecified ",

"AdjustResize", "adjustPan"]... >

</Activity>

Attributes:

Android: windowSoftInputMode

How the main window of the activity interacts with a keyboard window that contains the screen. The setting of this attribute will affect two things.
:

1>
Keyboard status-whether it is hidden or displayed-when the activity
Activity becomes the focus of user attention.

2>
Adjust the main window of the activity-whether to reduce the size of the main window to free up space on the keyboard or whether the current focus of its content is visible when the part of the activity window is covered by the keyboard.

It must be set to a value in the following list or
"State ..." Add a value
"Adjust ..." Value combination. Set multiple values in any group-multiple
"State ..." Values, such &
Mdash has undefined results. Use
| Separated. For example
: <Activity android: windowSoftInputMode = "stateVisible | adjustResize"...>

Value set here
(
"StateUnspecified" and
Other than "adjustUnspecified"
) Will overwrite the value set in the topic.

Value

Description

"StateUnspecified"

Soft Keyboard status
(Whether it is hidden or visible)
) Is not specified. The system selects an appropriate status or topic-dependent setting.

This is to set the default behavior of the software disk.

"StateUnchanged"

The keypad remains visible or hidden no matter what the last time it was, when the main window appears in front of it.

"StateHidden"

When you select this
Activity, the keyboard is hidden-that is, when the user is sure to navigate to this
Activity, instead of returning it because it leaves another
Activity.

"StateAlwaysHidden"

The keyboard is always hidden.
When the Activity Main Window gets the focus.

"StateVisible"

The soft keyboard is visible. When that is appropriate
(When you navigate
Main Activity window
).

"StateAlwaysVisible"

When you select this
Activity, the keyboard is visible-that is, when the user is sure to navigate to
Activity, instead of returning it because it leaves another
Activity.

"AdjustUnspecified"

It is not specified whether
Activity Master
Adjust the size of the window to set aside the space for the soft keyboard, or whether the content in the window is visible to the current focus on the screen. The system automatically selects one of these modes, depending on whether the window content has any layout.
Views can scroll their content. If there is such a view, the window will be adjusted. This assumption can make the content of the scrolling window visible in a small area. This is the default behavior of the main window.
.

"AdjustResize"

The
The main Activity window is always adjusted to the screen size to allow space on the keyboard.

"AdjustPan"

The
The main Activity window does not adjust the screen size to allow space on the keyboard. On the contrary, the content of the current window is 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. This is usually not expected to be adjusted because the user may close the keyboard to obtain interaction with the covered content.

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.