I'm trying to style text inEditText
. I've managed to stytle the EditText
itself, but not its content. How can I go about changing the font weight, font color, style etc for text held inside the EditText
?
This is how I style the EditText
view:
<?xml version="1.0" encoding="utf-8"?>
<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
android:paddingBottom="10dp"
android:paddingLeft="42dp"
android:paddingRight="10dp"
android:paddingTop="10dp">
<item android:bottom="3dp">
<bitmap
android:gravity="center_vertical|left"
android:src="@drawable/ic_games_black_24dp" />
<shape android:shape="rectangle">
<stroke
android:width="1dp"
android:color="#37474f" />
</shape>
</item>
</layer-list>
Then I call it:
EditText editText = new EditText( mContext );
editText.setHint(" Find");
editText.setWidth(555);
editText.setBackgroundResource(R.drawable.add_new_bag_dr);
What is the best way to go about it? What options do I have?
UPDATE
How can I attach a style defined in an XML to a View?