如何在Jake Wharton的TitlePageIndicator中设置字体?

Bas*_*rif 1 android typeface android-viewpager actionbarsherlock

在我的应用中我使用Jake Wharton的TitlePageIndicator.我想知道我们是否可以将字体设置为TitlepagerIndicator.

这是xml,

<com.viewpagerindicator.TitlePageIndicator
     android:id="@+id/indicatortitle"
     android:layout_width="fill_parent"
     android:layout_height="wrap_content"
     android:layout_marginBottom="10dp"
     android:padding="10dip"
     app:selectedColor="#000"
     android:textColor="#a0a0a0"
     android:textSize="25dp" />
Run Code Online (Sandbox Code Playgroud)

在主要活动中,

    TitlePageIndicator indicator = (TitlePageIndicator)findViewById(R.id.indicatortitle);
indicator.setViewPager(mViewPager);
    indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
Run Code Online (Sandbox Code Playgroud)

esk*_*ski 7

如果你查看代码TitlePageIndicator.java,你会看到它扩展了View并覆盖了setTypeface()方法,所以YES.

只需执行:indicator.setTypeface(your_typeface);