0

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?

ninge
  • 1,592
  • 1
  • 20
  • 40
  • This is not a duplicate because the other question and answers do not explain how to set the font using a SpannableString with a TypfaceSpan. – ninge Jan 08 '14 at 04:03
  • the other questions/answers do also not explain how to set the font to an array of titles. – ninge Jan 08 '14 at 04:05
  • have a look at this, http://stackoverflow.com/questions/7247113/using-html-in-textview – LOG_TAG Jan 08 '14 at 04:08

0 Answers0