我想更改PagerSlidingTabStrip
中标签的字体,这是我尝试的方式,但它没有效果。
MyPagerAdapter pagerAdapter = new MyPagerAdapter(getSupportFragmentManager());
viewPager.setAdapter(pagerAdapter);
pagerSlidingTabStrip.setViewPager(viewPager);
pagerSlidingTabStrip.setTextColor(getResources().getColor(R.color.white));
pagerSlidingTabStrip.setTypeface(Typeface.createFromAsset(getAssets(), getString(R.string.ronney_sans_regular_font)), Typeface.NORMAL);
pagerSlidingTabStrip.setIndicatorColor(getResources().getColor(R.color.second_primary_color));
答案 0 :(得分:0)
如果您使用此库:
https://github.com/jpardogo/PagerSlidingTabStrip
在PagerSlidingTabStrip类更改行185:
mTabTextTypeface = Typeface.create(tabTextTypefaceName, mTabTextTypefaceStyle);
到此:
mTabTextTypeface = Typeface.create(Typeface.createFromAsset(context.getAssets(),"DroidNaskh.ttf"), mTabTextTypefaceStyle);