8

I want to make the EditText hint appear in capital case characters without adding an upper case string in the strings file, Any help?

3
  • Only hint or always?
    – frogatto
    Aug 14, 2016 at 16:17
  • android:hint="Your Hint Text" ...
    – Riad
    Aug 14, 2016 at 16:18
  • @HiI'mFrogatto Always Aug 14, 2016 at 16:51

1 Answer 1

8

I think this is an example you can try:

myEditText.setHint(getResources().getString(R.string.your_text_in_string).toUpperCase());
3
  • 3
    no way I can do something like this in the layout XML? Aug 14, 2016 at 16:50
  • @SherifElNady I think the only way is do it programmatically (my answer) if you want to get from strings file :)
    – Huy
    Aug 14, 2016 at 17:48
  • 2
    disappointed that I have to resort to setting this one thing programmatically..but thanks for the suggestion!
    – Aba
    Oct 20, 2017 at 4:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.