Auto-wrap and change to enter key for Android EditText

Source: Internet
Author: User
Cited

We have accumulated a lot of tricks on the use of EditText controls for a long time, such as the type of input (phone number, number type, mailbox, text ...). ), cursor changes, default input font ...
In fact, there are a lot of combinations of Android EditText, and also with the Android version has a very deep relationship.

We will find that when we enter text in the EditText, the cursor will move backwards as your text increases, but in some versions of Android it will not wrap, and there is a possibility that you have set the ENTER key to "done", Android: Imeoptions= "Actiondone"
, if this is what you need to change the line, just change the type of input:
Android:inputtype= "Textmultiline" (denotes multiple lines of input)

Counter Example

When we want to set the EditText's enter key on the icon, just change android:imeoptions= "Actiondone" in the value can be,
But you will find that in some API versions, this writing does not work, this is what you need to add android:inputtype= "textmultiline" its input type, it is OK.

Summarize

Discover the various controls in Android really interesting, they are very good binding, but also admire the development of Android Google engineers, really good, think well comprehensive ah.

Auto-wrap and change to enter key for Android EditText

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.