Christopher Perry Christopher Perry - 1 year ago 111
Android Question

How do you remove the title text from the Android ActionBar?

I'm looking through the

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.

How can I do that?

Answer Source

Got it. You have to override


and then in your custom style you have to override


Here's a sample.

In my themes.xml:

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

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 name="NoTitleText">
        <item name="android:textSize">0sp</item>
        <item name="android:textColor">#00000000</item>

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download