Search code examples
androidandroid-actionbaractionbarsherlockandroid-spinnerandroid-holo-everywhere

How to custom widget like this? A Spinner? A submenu?


I want a widget like this on the action bar:

image

How can I custom the widget on the actionbar using holo everywhere or actionbarsherlock?

When clicked the Modify or the FaceBook Item, the Name text do not change, just like a menu.

A spinner or a button with dropDownItems?


Solution

  • You can achieve this with the action bar list navigation mode which uses a Spinner. Here is a simple example from the ActionBarSherlock samples.

    To have a static text at the top, you have to create your own Adapter to override getView(). There you inflate a layout with an image and the text "Name" and return it for all positions.