I have a ListView, all i want to do is to change the font. i already downloaded my font to the assets/fonts folder.
if i understand right, i supposed to rewrite the adapter..
here is my code:
onCreate....
Typeface font1 = Typeface.createFromAsset(getAssets(), "fonts/english.ttf");
font1 = Typeface.create(font1, Typeface.BOLD);
TextView customText = (TextView)findViewById(R.id.ListTextView);
customText.setTypeface(font1);
HashMap<String,String> contentItem = new HashMap<String,String>()
{
{
put(NAME_FIELD,"dudi");
}
};
content.add(contentItem);
SimpleAdapter adapter = new SimpleAdapter(this,
content,
R.layout.show_the_list,
new String[]{NAME_FIELD},
new int[]{R.id.ListTextView} );
ListView list1 = (ListView) findViewById(R.id.list);
list1.setAdapter(adapter);
the xml file:
<TextView
android:id="@+id/ListTextView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="40dip"
android:textColor="@color/White" >
</TextView>
if someone can show me the code that i need to add or change, it will be great! thanks.