I want to set a custom font for the titles in my PagerTabStrip
. I would like to use a SpannableString
. Similar to:
SpannableString s = new SpannableString("Title Array Here");
s.setSpan(new TypefaceSpan(this, "MyTypeface"), 0, s.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
My titles are in an array and use getPageTitle(int position)
in the simple code:
String [] titlesArray = new String []{ "Title 1" , "Title 2" , "Title 3"};
public CharSequence getPageTitle(int position) {
return titlesArray [position];
}
So my question: How can I set a custom font to my array of titles in my PagerTabStrip using a SpannableString with a TypfaceSpan?