0

This is a simple Android question that is hard to explain. For an EditText field, I need 18 characters. I limited the lenght of the edittext now with android:maxLength="18"

What I really need to do is show a dot for each character, or something like a placeholder for each character. I know you can use a real placeholder in Android, but it disappears when you start to enter your text.

Do you guys know any library or other solution for this?

UPDATE: I rather not use 18 seperate edittexts. That would be a lot of hassle to use a textwatcher on each EditText etc..

TomCB
  • 3,983
  • 9
  • 40
  • 66
  • possible duplicate of [Change EditText password mask character to asterisk (\*)](http://stackoverflow.com/questions/14051962/change-edittext-password-mask-character-to-asterisk) – Phantômaxx Feb 03 '15 at 15:58
  • possible duplicate of http://stackoverflow.com/questions/8221072/android-add-placeholder-to-edittext – rogerwar Feb 03 '15 at 16:01

1 Answers1

0

After trying out your suggestions, I found a solution of my own.

I placed two editTexts on top of each other, set the text of the top editText to 18 dots(.) and enabled to false (to get the greyish look). I left the other editText untouched.

In code I set both the typeFaces to monospace, to each character would have the same size.

The output is an editText with a grey dot for every character, exactly what I wanted.

Thanks for the help guys, I appreciate it!

TomCB
  • 3,983
  • 9
  • 40
  • 66