简体   繁体   English

在PreferenceScreen中使用自定义字体

[英]Use custom type face in PreferenceScreen

How to change type face of PreferenceScreen to use a custom font? 如何更改PreferenceScreen字体以使用自定义字体? Because PreferenceScreen is a final class, there is no way to extend it and set its type face in onBindView(View) . 由于PreferenceScreen是最终类,因此无法扩展它并在onBindView(View)设置其类型face。

You can attempt to iterate over all widgets in your PreferenceActivity , find those inheriting from TextView , and adjust their font. 您可以尝试遍历PreferenceActivity所有小部件,找到从TextView继承的小部件,并调整其字体。 Bear in mind, though, that this will only affect the PreferenceActivity , not any dialogs those Preference objects display. 但是请记住,这只会影响PreferenceActivity ,而不影响那些Preference对象显示的对话框。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM