Enter key of the custom keypad

Source: Internet
Author: User

When we use Sina Weibo to log on and register, we will find that when the mouse is placed on the first edittext component, the Enter key of the software will change to the next button. When it is placed on the last edittext, the enter key is changed to the "finish" button. This is very beneficial for users to use software for information input, with a good user experience.
In fact, the specific implementation steps are very simple.

If our layout contains multiple edittext controls and the Android: singleline attribute of each control is set to true, the text on the Enter key on the Soft Keyboard will change to "Next", and the next edittext will automatically get the focus (implementing the "Next" function ); when the last control gets the focus, the text on the Enter key is changed to "done", and the keyboard is automatically hidden after being pressed.

Set the imeoptions attribute of edittext to different values. Different texts or patterns can be displayed on the Enter key.
For example, set imeoptions of edittext to actionnext,
Set imeoptionslabel of edittext to "Next"
The enter key in the soft keyboard is changed to the "Next" button. After clicking it, the focus will jump to the next edittext control.

The imeoptions attributes of edittext are divided:
Actionnone: Enter key. Press the button and move the cursor to the next line.
Actiongo: Go,
Actionsearch: a magnifier
Actionsend: Send
Actionnext: Next
Actiondone: done to hide the keyboard, even if it is not the last text input box

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.