I need to set the hint of a EditText as italic style, but I can't find any place how to do it.
Some one here has a clue how to do it or do I have to accept that is impossible?
I need to set the hint of a EditText as italic style, but I can't find any place how to do it.
Some one here has a clue how to do it or do I have to accept that is impossible?
Inside strings.xml
<string name="hint1"><i>Your hint here</i></string>
In your .xml file
<EditText android:hint="@string/hint1" />
<em></em>
and it did not work. –
Synodic <i>
to the user, but it is now the preferred tag in most use cases. Here's an explanation. –
Synodic Add one string value in Strings.xml as <i>your hint here</i>
and try to set it in your EditText in the xml
Solution 2:
if(youredittext.getText().toString().length()==0)
{
youredittext.setTypeface(null,Typeface.ITALIC);
}
else
{
youredittext.setTypeface(null,Typeface.NORMAL);
}
<i>hint</i>
works very well and look good in the xml. –
Acetone In your xml, you can set a TextStyle. This TextStyle is applicable on your text and your hint.
<EditText
android:id="@+id/editText"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:hint="@Your text here"
android:textStyle="italic"/>
© 2022 - 2024 — McMap. All rights reserved.