Change font of PagerSlidingTab strip?

565 views Asked by At

I would like to know if there's any way to change the tab font with Pager Sliding Tab strip? https://github.com/astuetz/PagerSlidingTabStrip

I have read through the documentation as I cannot find a way to change the tab fonts. If someone knows how do it then please leave a solution, thanks.

2

There are 2 answers

0
Anthony N. On

In the source code (library/src/com/astuetz/PagerSlidingTabStrip.java), there's a setTypeFace method (line 508).

public void setTypeface(Typeface typeface, int style)

Try using that method on your Tab strip object.

0
user3249842 On

I also had this problem. Instead of "Pager Sliding Tab strip" I am using "SlidingTabLayout" and "SlidingTapStrip".

To change typo there just ad e.g.:

textView.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));

to "SlidingTapLayout"'s:

protected TextView createDefaultTabView(Context context) { ... }

That's it!