How to Remove the Title Text from the Android Actionbar

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

Got it. You have to override

android:actionBarStyle

and then in your custom style you have to override

android:titleTextStyle

Here's a sample.

In my themes.xml:

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

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>

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 remove actionbar title keeping toolbar menu

Simply add this in your MainActivity this will hide the text of your toolbar

getSupportActionBar().setTitle("");

To remove the toolbar you can set it's visibility to gone like

android:visibility="gone"

Android - How to remove app name from ActionBar

ActionBar actionBar = getActionBar();
actionBar.setDisplayShowTitleEnabled(false);
actionBar.setDisplayShowHomeEnabled(false);

Or you can just call actionbar.setTitle("")

Remove title from action bar activity

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

<style name="AppBaseTheme" parent="android:Theme.Holo">
<item name="android:actionBarStyle">@style/AppBaseTheme.ActionBar</item>
</style>

<style name="AppBaseTheme.ActionBar" parent="@android:style/Widget.Holo.ActionBar">
<item name="android:displayOptions">showHome|useLogo</item>
</style>

Remove the title text from the action bar in one single activity

For this kind of simple stuff you just have to go to the source to find the answer:
here the full explanation: http://developer.android.com/guide/topics/ui/actionbar.html#Dropdown

and here some guide code, to include the spinner on the action bar:

 ActionBar actionBar = getActionBar();
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);

after that is just put a listener for the changes and setting the a spinner adapter.

and you can use:

 setTitle("");

to remove the title.
I've been checking on my codes here, you can also give a try on:

 requestWindowFeature(Window.FEATURE_NO_TITLE);

It should just remove the title, and leave the title bar. Remember that you must call this before setContentView

happy coding.

Hide ActionBar title

Remove the activity's label attribute value to "" blank in the manifest. this will remove appname title.

If label not available then add lable="". This will also remove name on toolbar

android:label="@string/app_name"

to

android:label=""

Remove title in Toolbar in appcompat-v7

getSupportActionBar().setDisplayShowTitleEnabled(false);

how to remove the title of my activity when I add a button navigation?

Try this

this.getSupportActionBar().hide();

To hide entire ActionBar

Or you can try this ON YOUR activity

this.requestWindowFeature(Window.FEATURE_NO_TITLE);

It will hide your text only

How to remove title bar from the android activity?

Try this:

this.getSupportActionBar().hide();

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

try
{
this.getSupportActionBar().hide();
}
catch (NullPointerException e){}

setContentView(R.layout.activity_main);
}


Related Topics



Leave a reply



Submit