Android Soft keyboard pop-up hidden extrusion interface and so on a variety of issues summary _android

Source: Internet
Author: User

The use of soft keyboard in Android is very much, the following for the soft keyboard commonly used settings;

1, Horizontal screen, click the input box appears full keyboard solution: In EditText, Searchview and other controls add

 
 

2, the vertical screen, Android will appear half screen.

CASE1: Your input box is in the lower position, so the keyboard may block the input box. WORKAROUND: Set the activity in manifest

 
 

This activity's main window always resize the keyboard for space

CASE2: Your input box is on the bias, generally this will not have any problems, but if your interface in the vertical use of layout_weight that is the proportion to distribute the page, the software disk will compress the entire window, resulting in a part of the input box compression. WORKAROUND: Set the activity in manifest

 
 

This way the keyboard does not compress the original window, but only covers the following sections. This allows the input box to not be compressed.

3, just enter an activity, will focus input box, then will actively eject the soft keyboard, if you do not want to automatically eject, then you can let other unimportant control get focus, and then a timer let EditText get focus!

4, to determine whether the soft keyboard is currently in the pop-up state

 
 

5. Manually hide the soft keyboard

GetWindow (). Setsoftinputmode (WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN);

6. Manually eject the soft keyboard

 
 

The above is a small series to introduce the Android soft keyboard pop-up hidden extrusion interface, such as a summary of the various issues, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!

Related Article

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.