-1

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?

Matthias Robbers
  • 15,689
  • 6
  • 63
  • 73
matrix1024
  • 27
  • 1
  • 8

1 Answers1

0

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.

Matthias Robbers
  • 15,689
  • 6
  • 63
  • 73
  • Hello,I'm new on Android.As you say,can I use listnavigation mode + Override ArrayAdapter(override the getView and getDropDownView method),but in actionbarsherlock or holoeverywhere the listnavigation will lose theme,can u give me a demo?many thanks. – matrix1024 Jan 22 '13 at 03:19
  • Hello,matthias,I got another problem,the onPrepareOptionsMenu method not called in my Fragment sub class(this.setHasOptionsMenu(true); ) while using HoLo Everywhere. – matrix1024 Jan 22 '13 at 05:59
  • The fact that I did not answer your extra questions does not justify unaccepting the answer. It is 100% correct and has nothing to do with your further problems with themes and fragments. You will have to create new questions for these issues. – Matthias Robbers Feb 18 '13 at 08:29