Android IME Keyboard and Activity page occlusion problem resolution

Source: Internet
Author: User

I believe you will encounter the development of the soft keyboard pop-up, the input box can not see the input box, in fact, as long as the Webview put in the ScrollView , ScrollView changed to linearlayout problem solved, will not pop the soft keyboard after a large scroll. However, the following is a detailed description of the soft keyboard and Activity page occlusion problem.

normally if we enter content in an input box, when the input keyboard pops up, activity automatically sets the height, which is equivalent to scrolling up the activity to add the Input method keyboard height. However, sometimes it may overwhelm the current input box, and if you want the input keyboard to pop up without automatically squeezing the activity, set the property in activty android:windowsoftinputmode= " Adjustpan ", so that the input method can overwrite Activity display, as follows:

<activity android:name= "testactivity" android:windowsoftinputmode= "Adjustpan" >


set the property to android:windowsoftinputmode= "Adjustresize" to automatically adjust the height.

The Statevisible property indicates that the Input method keyboard is displayed by default, and other properties are shown in:Android:windowsoftinputmode

Adjustpan also has the problem, that may need to turn off the soft keyboard, positioning the blocked input box, I want to be between the Adjustpan and adjustresize solution, that the soft keyboard will Activity has a certain squeeze, but the focus of the input box will always be displayed on the screen, there will be friends welcome message sharing, personally think possible solution is new a linearlayout, rewrite the

protected void onsizechanged (int w, int h, int oldw, int oldh)


of course, after the development The APP also needs a full range of tests:www.ineice.com


Android IME Keyboard and Activity page occlusion problem resolution

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.