How to remove Application icon from Action Bar in Android? - android

I am using Action bar with Tabs. I want to hide app icon from action bar. I use the below code, but action bar is showing below Tabs. Both are not useful for me.
Any one help me!
actionBar.setDisplayUseLogoEnabled(false);
and
actionBar.setDisplayShowHomeEnabled(false);

actionBar.setDisplayUseLogoEnabled(false); should do it.

add
actionBar.setDisplayShowTitleEnabled(false)

Related

Navigation Drawer icon not shown

I am using Custom Action bar. For which the code i am using is -
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
getActionBar().setCustomView(R.layout.custom_home_action_bar);
ActionBar bar = getActionBar();
bar.setBackgroundDrawable(new ColorDrawable(getResources().getColor(
R.color.color_dark_blue)));
but when I use this code to customise my action bar, navigation drawer icon is not shown. When I comment these lines it is perfectly shown but then I cannot customise my action bar.How can i achieve both?
Thanks in advance
I got the solution. I used
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM | ActionBar.DISPLAY_SHOW_HOME);
instead of
getActionBar().setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);

Android Split Action Bar Without Icon

My question is stupid I know, but i have no single idea how to solve that problem.
I followed Android API and perfectly made Split Action Bar, without problem.
http://developer.android.com/guide/topics/ui/actionbar.html#SplitBar
But when i decided to remove activity icon action bar drops down under the tabs and i can not find out why.
actionBar = getActionBar();
actionBar.setDisplayHomeAsUpEnabled(false);
//actionBar.setDisplayShowHomeEnabled(false);
actionBar.setDisplayShowTitleEnabled(true);
actionBar.setDisplayUseLogoEnabled(false);
actionBar.setTitle("Contacts");
actionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
After I remove comment (remove Icon respectivaly), tabs get up and bar gets down.

how to hide action bar in swipe view with tabs

Here's a link
I want to hide the action bar (application title bar)/full screen activity of application how can i do that??
You can hide the action bar by adding <android:theme="#android:style/Theme.NoTitleBar"> to your manifest, or programmatically :
getActionBar().hide();
// with abs
getSupportActionBar().hide();
This link may be helpfull

Customize Action Bar Sherlock

I am working on an app in which I have implemented Action Bar using Action Bar Sherlock. I have also assigned style to it using Action Bar Style Generator from the following link:-
(http://jgilfelt.github.io/android-actionbarstylegenerator/#name=test_style&compat=sherlock&theme=light&actionbarstyle=solid&texture=0&hairline=0&backColor=9c0%2C100&secondaryColor=D6D6D6%2C100&tabColor=33B5E5%2C100&tertiaryColor=fff%2C100&accentColor=ff0%2C100&cabBackColor=fff%2C100&cabHighlightColor=33B5E5%2C100)
Its perfectly doing what I want but now my problem is that I have no control on the font type/size/color of the title of Action Bar or even on the pop-up menu font. I just want to know how can I change the font size/type/color of my Action Bar from the styles that I have generated from the above link.
Please help me to sort this out, any help would be appreciable
Thanks in Advance.

Customize the action bar color background changing

I am trying to add and action bar to my app, and customize it.
i used onCreateOptionMenu() and Inflaters to add to my code.
but i don't know how to customize background and remove that package name which appears next to the logo so i can give more "Room" to my items to be displayed correctly.
can anybody help please?
Thank you in advance.
I would suggest to create a custom action bar in layout folder and use it with below code:
ActionBar actionBar = getActionBar(); //Applications action bar isntance
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
actionBar.setCustomView(R.layout.my_action_bar);
If you use this, you can directly use action bar view's content and do whatever you want.

Categories

Resources