将自定义字体设置为“设置活动首选项”标题

时间:2019-02-16 07:00:38

标签: java android

<preference-headers
   xmlns:android="http://schemas.android.com/apk/res/android">

 <header
   android:fragment=".SettingsPageActivity.SettingsActivity2$GeneralPreferenceFragment"
   android:icon="@drawable/ic_edit_black_24dp"
   android:title="Edit Profile" />

 <header
  android:fragment=".SettingsPageActivity.SettingsActivity2$NotificationPreferenceFragment"
  android:icon="@drawable/ic_user_profile"
  android:title="About us" />

 <header
   android:fragment=".SettingsPageActivity.SettingsActivity2$DataSyncPreferenceFragment"
   android:icon="@drawable/ic_power"
   android:title="Logout" />

</preference-headers>

我想更改上面标题的字体,如何为这些标题设置自定义字体。

Typeface tf = Typeface.createFromAsset(getContext().getAssets(), "open-sans-font/OpenSans-Regular.ttf");

0 个答案:

没有答案