How could I make an actionbar to have logo in the center and two action items on sides like this?
I will be using ActionBar Sherlock.
How could I make an actionbar to have logo in the center and two action items on sides like this?
I will be using ActionBar Sherlock.
As I noted in a comment, I am not exactly sure if any of this would change with ABS (I'm sure not much would), but with the standard Action Bar you can load a custom layout .xml for your action bar title. For example, you could have action_bar_title.xml:
Then, in your Activity, you would want to call a method like this in onCreate():
To take control of the left action item, you could do this in your Activity:
Of course, make sure you also do the other necessary setups for the Action items in your menu xml's as well. This will be for any right-sided action items.
Edit: Just saw in another comment you said that title would be an image. If that's the case, just replace the TextView I used in my example with your ImageView, and disregard the font customization code in the setupActionBar() method.
Edit2: I updated my Java code. You will need to do ab.setHomeAsUpEnabled(true), and then have a custom theme to implement an invisible (or perhaps @null although I don't know if Android will accept that) drawable for the home as up indicator. See here (taken from answer here:)