有人知道怎么做这个吗?PagerTitleStrip类没有.setTypeface方法或类似的任何东西,所以我有点难过.
我发现的另一个回应是:
You are probably best served copying the PagerTitleStrip code (in your SDK or available online), refactor your fork into your own package, and modify it to suit.但我不知道如何去做.
任何帮助将非常感激.
如果是自定义字体,请将其放在资产文件夹中并像这样更改.
PagerTitleStrip _Title = (PagerTitleStrip)rootView.findViewById(R.id.__Weekly_pager_title_strip);
Typeface font = Typeface.createFromAsset(getActivity().getAssets(), "Your font.ttf");
for (int counter = 0 ; counter<_Title.getChildCount(); counter++) {
if (_Title.getChildAt(counter) instanceof TextView) {
((TextView)_Title.getChildAt(counter)).setTypeface(font);
((TextView)_Title.getChildAt(counter)).setTextSize(25);
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2807 次 |
| 最近记录: |