EditText phone number mask for Android
•
Android
I'm developing an application for Android. In this application, users need to register and enter a phone number. I want to set a mask for this text field, such as 7 (999) 999-99-99. I've tried to use mphonenumberedittext. Addtextchangedlistener (New phonenumberformattingtextwatcher()); But only (999) 999-9999 format is provided. How do I format the required format?
resolvent:
https://github.com/pinball83/Masked-Edittext
<com.github.pinball83.maskededittext.MaskedEditText
android:id="@+id/masked_edit_text"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="number"
app:mask="+7 (***) ***-**-**"
app:notMaskedSymbol="*"/>
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码