About the Android soft keyboard put the layout on top of the problem

Source: Internet
Author: User

First of all I need to say: The top of the layout is a bar, there is the upper left corner back button and title, bar below is a scrollview, there are various TextView and EditText,

When you click on the edittext below, you do not want the soft keyboard to top up the bar (invisible).

Here are a few things to note:

1. In Androidmanifest, the corresponding activity configuration android:windowsoftinputmode= "Adjustresize|statehidden" can be resolved

2. But there is a problem, when the soft keyboard pops up, always flashes a black background.

3. Later found to be related to theme, remove the corresponding activity in the Android:theme= "@android: Style/theme.notitlebar" property, in

The activity of the OnCreate Setcontentview before adding requestwindowfeature (Window.feature_no_title);

Other:

1. Set android:windowsoftinputmode= "Adjustpan|statehidden" without a flashing black background, but will still put the bar up.

2.EditText remove Border and underline: Add Android:background= "@null" property to EditText

3. Enter the page, do not want all the EditText have the cursor: edit.setcursorvisible (FALSE); When clicked, the soft keyboard pops up and the cursor appears:

Edit.setontouchlistener (New Ontouchlistener () {
@Override
public boolean OnTouch (View V, motionevent event) {
TODO auto-generated Method Stub
Edit.setcursorvisible (TRUE);
return false;
}
}); (Note: Setonclicklistener does not work, click the first pop-up soft keyboard, point the second time to appear the cursor)

About the Android soft keyboard put the layout on top of the problem

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.