Android page has EditText, which cancels the auto-pop-up keyboard

Source: Internet
Author: User

The EditText in the Android canvas is the Focus
will automatically bounce the keyboard
It's a design that's easy for users to be accustomed to.
The pen was discovered at the beginning of the discovery
Sometimes it's convenient.

Reason

When you start to enter a page with EditText
EditText Will Self- Focus and bounce the keyboard
This is going to cause a trap depression
Because the user enters the page
It's not necessarily about entering the information.
Probably just looking at the information.
and the keyboard will occupy the more than half.

Resolution one (fail)

Many solutions on the Web are said to be on the outer Element.
Plus two of them.

12 android:focusable="true"android:focusableInTouchMode="true"

You can cancel the auto Focus
Avoid bouncing the keyboard
The pen has tried several times to fail.
After the setup, not only Focus was canceled.
Even EditText can not be a bit
Conjecture may be a different relationship between Android versions

Solution Method Two (success)

And then turn One direction.
Hit the trigger and hit the keyboard.
Find a windowsoftinputmode sex
You can control the state of the keyboard.
Even in the page EditText was Focus
And the keyboard won't bounce.

Androidmanifest.xml

1234 <activity    android:name=".MainActivity"    android:label="@string/title_activity_main"    android:windowSoftInputMode="stateHidden">

Before you make a change, you'll get a key in the page.

After the change, the entry page does not bounce the keyboard

Click EditText to bounce the keyboard.

There are EditText in the Android page, and when you enter it, cancel the auto-pop-up keyboard

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.