Set multi-line for EditText's HINT

后端 未结 5 1913
闹比i
闹比i 2021-02-14 08:03

I know that I could change the No. of lines for EditeText\'s Text, yet could I change that of EditText\'s hint as well?

I could not find a solution online.

Thank

5条回答
  •  感动是毒
    2021-02-14 08:44

    Nothing worked for me but:

     
    

    To be honest I don´t understand why.. but including "\n" as hint in the xml did the trick!

    Now you can call setHint from Java code:

    searchEditText.setHint(getString(R.string.search_hint));
    

    and remove the \n from strings.xml if you want to allow the text split automatically according to the room

    keyword, location, max price (e.g. 1K, 1M)
    

提交回复
热议问题