默认 ActionBar 标题字体大小是多少?
好像是17dip。只是想确认一下是否有人知道确切的尺寸。
Seems to be 17dip. Just want to confirm it if anyone knows the exact size.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
好像是17dip。只是想确认一下是否有人知道确切的尺寸。
Seems to be 17dip. Just want to confirm it if anyone knows the exact size.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(3)
简短的…
$ grep ActionBarplatforms/android-11/data/res/values/*
导致styles.xml:
The short one…
$ grep ActionBar platforms/android-11/data/res/values/*
leads tostyles.xml:
这对我有用。
这就是我获取默认工具栏样式的方法:
这可以保持默认样式
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
然后在您的活动中,您可以做:
This works for me.
This is what I do to get the default toolbar style:
This does the trick to keep the default style
style="@style/TextAppearance.AppCompat.Widget.ActionBar.Title"
Then in your activity, you can do:
我使用此代码获取
当前主题
Theme.MaterialComponents.DayNight.DarkActionBar
和androidx.appcompat.widget 的
。标题大小为 20,副标题为 16Toolbar
标题和副标题的文本大小。工具栏I use this code to get the text size of title and subtitle of
Toolbar
with my current theme
Theme.MaterialComponents.DayNight.DarkActionBar
withandroidx.appcompat.widget.Toolbar
. title size is 20 and subtitle is 16