你如何删除从Android动作条标题的文本? [英] How do you remove the title text from the Android ActionBar?

查看:111
本文介绍了你如何删除从Android动作条标题的文本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我期待通过 Holo.Light 主题,我似乎无法找到魔幻风格覆盖摆脱标题文本的简要节目若我的应用程序第一次启动。

I'm looking through the Holo.Light theme, and I can't seem to find the magic style to override to get rid of the title text that briefly shows up when my app first launches.

我怎么能这样做?

推荐答案

明白了。你必须重写

android:actionBarStyle

,然后在您的自定义风格,你必须重写

and then in your custom style you have to override

android:titleTextStyle

下面是一个示例。

在我的themes.xml:

In my themes.xml:

<style name="CustomActionBar" parent="android:style/Theme.Holo.Light">
        <item name="android:actionBarStyle">@style/CustomActionBarStyle</item>
</style>

和我styles.xml:

And in my styles.xml:

<style name="CustomActionBarStyle" parent="android:style/Widget.Holo.ActionBar">
        <item name="android:titleTextStyle">@style/NoTitleText</item>
        <item name="android:subtitleTextStyle">@style/NoTitleText</item>
</style>

<style name="NoTitleText">
        <item name="android:textSize">0sp</item>
        <item name="android:textColor">#00000000</item>
</style>

我不知道为什么TEXTSIZE设置为零,没有达到目的(它缩小了文字,但没有让它消失),但文字颜色设置​​为透明的作品。

I'm not sure why setting the textSize to zero didn't do the trick (it shrunk the text, but didn't make it go away), but setting the textColor to transparent works.

这篇关于你如何删除从Android动作条标题的文本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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