在我的应用程序中,我正在使用 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" />
在主要 Activity 中,
TitlePageIndicator indicator = (TitlePageIndicator)findViewById(R.id.indicatortitle);
indicator.setViewPager(mViewPager);
indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
最佳答案
如果您查看代码 TitlePageIndicator.java,您会发现它扩展了 View 并覆盖了 setTypeface() 方法,所以是的。
只需做:indicator.setTypeface(your_typeface);
关于android - 如何在 Jake Wharton 的 TitlePageIndicator 中设置字体?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15263750/