对话框标题的自定义字体

发布于 2024-10-10 03:23:51 字数 184 浏览 0 评论 0原文

在我正在构建的应用程序中,我试图系统地将每段文本的字体更改为自定义字体。有谁知道是否可以将自定义字体等样式应用于对话框的标题?

到目前为止,我还没有找到一种方法,所以我最好的选择似乎是使用 AlertDialog,并在我膨胀的布局中使用文本视图作为我的标题。这有点啰嗦,所以如果有一种直接的方法来自定义对话框标题的样式,那会节省一些时间!

In an application I'm building, I'm trying to systematically change the font of every piece of text to a custom font. Does anyone know whether it's possible to apply styles such as custom typefaces to the title of a dialog?

So far, I haven't been able to find a way, and so my best bet seems to be to use an AlertDialog, and just use a textview as my title in a layout that I inflate. This is a bit long winded, so if there's a direct way to customize the style of the dialog's title, that would save some time!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

过度放纵 2024-10-17 03:23:51

尝试使用/继承 DialogWindowTitle 和/或 @style/TextAppearance.DialogWindowTitle

请参阅 https://android .googlesource.com/platform/frameworks/base/+/master/core/res/res/values/styles.xml

Try using/inheriting DialogWindowTitle and/or @style/TextAppearance.DialogWindowTitle.

See https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/values/styles.xml

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文