Android restrictions only enter certain values including numbers, letters, etc.

Source: Internet
Author: User

Restrict entering only certain values including numbers, letters, etc.

Android:digits= "0123456789ABCDEFGHIGKLMNOPQRSTUVWXYZ"

The above line of code can be any of your restrictions, you can only enter what is written on it, it is written only can enter numbers and letters.

Android:inputtype= "Textpassword" android:digits= "0123456789abcdefghigklmnopqrstuvwxyz"
Here is only the number and letter and the password format, the two settings do not conflict, android:inputtype= "Textpassword" Here is the text, can be entered in Chinese, but if you add android:digits= " 0123456789abcdefghigklmnopqrstuvwxyz ", InputType here the Chinese will be invalid, but password will not fail, here is just an analogy, we all understand.

Property value of InputType

    Android:inputtype= "None" android:inputtype= "text" android:inputtype= "textcapcharacters" Letter Capital Android:inputtyp E= "Textcapwords" uppercase Android:inputtype= "Textcapsentences" only the first letter capitalized android:inputtype= "Textautocorrect" auto-complete and Roid:inputtype= "Textautocomplete" auto-complete android:inputtype= "textmultiline" multi-line input android:inputtype= "TextImeMultiLine" Input method Multiline (if supported) android:inputtype= "Textnosuggestions" does not prompt android:inputtype= "Texturi" url android:inputtype= "TextEmail Address "e-mail address android:inputtype=" textemailsubject "Mail subject android:inputtype=" Textshortmessage "SMS Android:inputty Pe= "textlongmessage" long message android:inputtype= "Textpersonname" name android:inputtype= "textpostaladdress" Address android:i nputtype= "Textpassword" Password android:inputtype= "Textvisiblepassword" Visible password android:inputtype= "TextWebEditText" as a Web Form Text android:inputtype= "TextFilter" Text filter filter android:inputtype= "textphonetic" Pinyin input//numeric type android:inputtype= "Number" Digital android:inputtype= "nUmbersigned "Signed number format android:inputtype=" numberdecimal "floating point format with decimal point android:inputtype=" phone "dial pad android:inputtype = "datetime" Time Date android:inputtype= "date" android:inputtype= "Time" keyboard


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Android restrictions only enter certain values including numbers, letters, etc.

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.