在我的項目中,我使用字體android:fontFamily =「sans-serif-light」,並且正常工作。在viewpagerindicator中使用自定義字體
我也在使用library viewpagerindicator。我想在viewpagerindicator中使用字體android:fontFamily =「sans-serif-light」,但無法找到如何去做
我試過在<com.viewpagerindicator.TitlePageIndicator ...
中使用android:fontFamily = "sans-serif-light"
,但是沒有成功。
我也曾嘗試:
PageIndicator mIndicator = (TitlePageIndicator) findViewById (R.id.indicator);
Typeface myTypeface = Typeface.createFromAsset (getAssets(), "fonts/Roboto-Light.ttf");
mIndicator.setTypeface (myTypeface);
但這並不工作..
我感謝所有幫助。
感謝和問候
看到我在這裏發佈的解決方案:http:// stackoverflow。com/a/21786373/752781 – pandre