对话框标题的自定义字体
在我正在构建的应用程序中,我试图系统地将每段文本的字体更改为自定义字体。有谁知道是否可以将自定义字体等样式应用于对话框的标题?
到目前为止,我还没有找到一种方法,所以我最好的选择似乎是使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试使用/继承
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