Hosni
Hosni

Reputation: 668

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.

Upvotes: 0

Views: 1360

Answers (1)

AndroDev
AndroDev

Reputation: 3284

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.

Upvotes: 2

Related Questions