Edittext with Mask

Asked

Viewed 61 times

1

I needed a mask for a tractor horimetro with 5 fields a comma and a capo later.
Example: "#####,#" I even found a cool Maskedit, follow the link: https://github.com/toshikurauchi/MaskedEditText
The Only problem is that I need Edittext’s hint to be with the text "Horimetro *" and it turns out that the mask eats the characters of the hint causing it to stay "Horim,e" I wonder if there is a solution to this or if there is any other Maskedit that suits me

1 answer

0

Try using a Textwatcher and put the hint in your XML. Below is an example of a zip code mask:

EditText edtTextCEP = (EditText) findViewById(R.id.edt_txt_cep);    
TextWatcher textWatcherCep = Mask.insert("#####-###", edtTextCEP);
edtTextCEP.addTextChangedListener(textWatcherCep);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.