Android Control Soft Keyboard

Source: Internet
Author: User


display the soft keyboard by setting the Android:windowsoftinputmode= "" Control

The parameters are divided into two categories: state* and adjust*, which set the display and hiding of the soft keyboard, which affects the layout of the current display page. You can set both state* and adjust* two parameters, for example: <activity android:windowsoftinputmode= "Statevisible|adjustresize" >

Stateunspecified
No state is specified, the soft keyboard is displayed when there is an input box, and vice versa.
Stateunchanged
The status does not change, the previous interface display is currently displayed, but not displayed.
Statehidden
Hidden state, default hidden soft keyboard
Statealwayshidden
Always hide the state, no matter how soft keyboard is displayed

Statevisible
Show status, default display soft keyboard
Statealwaysvisible
Always show the status, show the soft keyboard anyway

Adjustunspecified
The system hides the title bar when the soft keyboard area is not sufficient, depending on whether the current page has a scrolling view.

Adjustresize with scroll control can use this, if the page fills the entire screen, when the soft keyboard pop-up, the page will be refreshed, the interface to remove the soft keyboard part as the entire page re-layout display page information, that is, automatic compression layout. For example, this layout can be used if a view of the page needs to be top-up. 1. Set the view to 2 at the bottom of the page. Linear layout, set the middle part to Weight = 1, height = 03. Rewrite the layout in Onsizechange to see if the soft keyboard is displayed, and adjust the view to the desired position.
Adjustpan
If a soft keyboard pops up, the view underneath the soft keyboard display area is obscured by directly overwriting the bottom of the screen.

Android Control Soft Keyboard

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.