设置操作栏/选项卡中文本的格式

发布于 2024-12-28 18:59:54 字数 138 浏览 2 评论 0原文

我正在使用 Action Bar Sherlock 提供的“Styled”示例。

我在原来的三个选项卡中添加了几个选项卡并更改了它们的名称。但现在看起来很糟糕,因为选项卡标题太大而无法显示,所以所有内容都在狭窄的空间中滚动。是否可以减小文本大小?

I'm playing around with the "Styled" Sample provided by Action Bar Sherlock.

I added a couple tabs to the original three tabs and changed their names. But now it looks awful because the tab titles are too big to be displayed so everything is scrolling in a narrow space. Is it possible to decrease the text size?

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

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

发布评论

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

评论(1

纸伞微斜 2025-01-04 18:59:54

您只需要覆盖默认的选项卡文本样式:

<style
    name="MyActionBarTabTextStyle"
    parent="Widget.Sherlock.ActionBar.TabText">
    <item name="android:textSize">12sp</item>
</style>

并记住在主题中引用它两次:

<item name="actionBarTabTextStyle">@style/MyActionBarTabTextStyle</item>
<item name="android:actionBarTabTextStyle">@style/MyActionBarTabTextStyle</item>

You just need to override the default tab text style:

<style
    name="MyActionBarTabTextStyle"
    parent="Widget.Sherlock.ActionBar.TabText">
    <item name="android:textSize">12sp</item>
</style>

And remember to reference it twice in your theme:

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