CollapsingToolbarLayout的字体 [英] Font for CollapsingToolbarLayout

查看:81
本文介绍了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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆