Android does not allow the pop-up keyboard to block the view

Source: Internet
Author: User

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> soft keyboard status-whether it is hidden or displayed-When 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 for the soft keyboard or whether the current focus of its content is visible when the part of the activity window is covered by the soft keyboard.

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 ..." Values. For example, & mdash has undefined results. 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

Value

Description

"Stateunspecified"

The 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 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 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 it is appropriate (when you navigate to the activity main window ).

"Statealwaysvisible"

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

"Adjustunspecified"

It is not specified whether the activity main window is adjusted to set aside space for the soft keyboard, or whether the content of the window is visible to the current focus on the screen. 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, 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 settings for the main window.

"Adjustresize"

The screen size of the main activity window is always adjusted to reserve space for the keyboard.

"Adjustpan"

The main window of the activity 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.