CollapsingToolbarLayout的字体 [英] Font for CollapsingToolbarLayout
问题描述
是否可以为CollapsingToolbarLayout
设置字体?
我正在使用书法,但未应用默认字体.
Is there a way to set the font for a CollapsingToolbarLayout
?
I'm using Calligraphy but my default font is not applied.
我认为问题是CollapsingTextHelper
类使用的是Canvas.drawText()
而不是TextView
.
I think the problem is the CollapsingTextHelper
class is using Canvas.drawText()
instead of a TextView
.
如何更改用于Canvas.drawText()
的默认字体?
How can I change the default font that is used for Canvas.drawText()
?
推荐答案
自最新的API更新以来,支持设计包已更新,现在可以设置折叠标题文本的字体.
Since one of the latest API updates, the Support Design Package has been updated and now it's possible to set the font of the collapsing title text.
使用 setCollapsedTitleTypeFace(Typeface typeface)
和 setExpandedTitleTypeFace(Typeface typeface)
来设置您的自定义字体.
Use setCollapsedTitleTypeFace(Typeface typeface)
and setExpandedTitleTypeFace(Typeface typeface)
to set your custom font.
这篇关于CollapsingToolbarLayout的字体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!