Android 如何在Jake Wharton';标题页指示器?

Android 如何在Jake Wharton';标题页指示器?,android,actionbarsherlock,android-viewpager,typeface,Android,Actionbarsherlock,Android Viewpager,Typeface,在我的应用程序中,我使用的是杰克·沃顿的TitlePageIndicator。我想知道我们是否可以将字体设置为TitlePageIndicator 这是xml <com.viewpagerindicator.TitlePageIndicator android:id="@+id/indicatortitle" android:layout_width="fill_parent" android:layout_height="wrap_content"

在我的应用程序中,我使用的是杰克·沃顿的TitlePageIndicator。我想知道我们是否可以将字体设置为TitlePageIndicator

这是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" />

如果查看代码TitlePageIndicator.java,您将看到它扩展了View并覆盖了setTypeface()方法,所以是的


只需做:indicator.setTypeface(你的字体)

如果您查看代码TitlePageIndicator.java,您将看到它扩展了View并覆盖了setTypeface()方法,所以是的


只需做:indicator.setTypeface(你的字体)

谢谢,它可以工作,但请确保它不会泄漏内存。android自定义字体存在错误;)谢谢,它可以工作,但请确保它不会泄漏内存。android自定义字体存在错误;)
    TitlePageIndicator indicator = (TitlePageIndicator)findViewById(R.id.indicatortitle);
indicator.setViewPager(mViewPager);
    indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);