Android Input Method occlusion

Source: Internet
Author: User

Http://www.eoeandroid.com/forum.php? MoD = viewthread & tid = 96904.

Android Input Method occlusion.

Check the android SDK instructions and find that you can solve this problem by setting an attribute of the activity. For example, you can write in androidmanifest. XML as follows:

Java code:

<Activity Android: Name = ". categorylist"

Android: Label = "@ string/app_name"

Android: windowsoftinputmode = "statealwayshidden | adjustresize">

</Activity>

Here, Android: windowsoftinputmode is used to avoid the problem of blocking the input method panel. For specific parameter descriptions, see the SDK documentation. However, it indicates that this attribute is added after Android 1.5, that is, the SDK after API Level 3 is supported. What should I do if I don't use it on machines like Lenovo O1? Fortunately, I found another solution, scrollview. We can add a scrollview to the top-level element of the corresponding layout XML. In this way, all text boxes will automatically scroll up when the input method panel is popped up. The sample code is as follows:

Java code:

<Scrollview xmlns: Android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "fill_parent

Android: layout_height = "fill_parent"

<Linearlayout Android: Orientation = "vertical"

Android: layout_width = "fill_parent"

Android: layout_height = "fill_parent">

<Edittext Android: Id = "@ + ID/content"
Android: layout_width = "fill_parent"
Android: layout_height = "wrap_content"
Android: lines = "4 ″
Android: scrollbars = "vertical"
Android: gravity = "fill_horizontal"/>
</Linearlayout>
</Scrollview>

Manifest added the Android: windowsoftinputmode parameter when the android Input Method overwrites the question in the bottom editing box. After you click the edit box, the effect is not displayed in the edit box.

The Android: windowsoftinputmode parameter is not added to manifest. After you click the edit box, the lower emoticons are overwritten.

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.