Hi I need a little help with using a custom typeface for a listview items. I’m getting my typeface from assets folder like this :
Typeface font = Typeface.createFromAsset(getAssets(), "hermesbgbold.otf");
And I’m trying to set it for my listview items, but the problem is that I’m using a SimpleAdapter for my ListView and the TextView’s are in another XML , which I’m using as a contentView for my list View. Here is the code for better understanding :
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.events);
// code
SimpleAdapter adapter = new SimpleAdapter(this, items, R.layout.events_items,
new String[]{ICON,TITLE, INFO}, new int[]{ R.id.thumb,R.id.title, R.id.dates})
}
So, the textview’s which I want to use with custom typeface are in events_items.xml. So how can I set title and dates to use this custom typeface?
Create your own custom adapter and set font for the text.