Android avoids the easy way to eject a soft keyboard to cover ListView _android

Source: Internet
Author: User

Do development, we often put ListView in the middle, and then place a edittext control, so that Editext control to get focus, Input Method pop-up, EditText control up, blocking the listview part of the data, this is not very beautiful. So, we need to get ListView to move up too, so we need to:

method One: in the XML file, set the ListView property when added this sentence is ok android:transcriptmode= "normal";

method Two: add a statement to the program:

Listview.settranscriptmode (Listview.transcript_mode_normal);

If you want to move the ListView up, that is, ListView scroll up as the item increases.

Listview.settranscriptmode (Abslistview.transcript_mode_always_scroll);

If you don't want the ListView to move up, don't let the ListView scroll up as the item increases.

Listview.settranscriptmode (listview.transcript_mode_disabled); <span style= "Color:rgb (51, 51, 51); font-family:arial; font-size:14px; line-height:26px; " >//</span><span style= "Color:rgb (51, 51, 51); font-family:arial; font-size:14px; line-height:26px; " > Data item still adds Listview</span><span style= "Color:rgb (51, 51, 51); font-family:arial; font-size:14px; line-height:26px; " > No scrolling,</span>

ListView data is refreshed and remains in its original position.

Set Listview.settranscriptmode (abslistview.transcript_mode_disabled) when the drop is refreshed;

Then calculate the original position, data refresh adapter.notifydatasetchanged ();

Next is to set the Listview.setselection, which is basically smooth, without beating. Nice experience, huh?

The above is small series for everyone brought Android to avoid pop-up soft keyboard cover ListView simple method of all content, I hope to help you, a lot of support cloud Habitat Community ~

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.