Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActionBarSherlock shows wrong colors and radio button on dropdown navigation spinner

I'm using ActionBarSherlock for ActionBar compatibility.

Everything works great except for the navigation dropdown spinner.

Testing with the emulator on Android 2.3 and below, I get a radio button on the spinner and also the text color is black.

It works well on Android 4+.

How can I remove the button and set the correct colors? Thanks.

Example image:

ActionBarSherlock on Android 2.33 emulator

like image 336
Ran Avatar asked Jul 23 '12 14:07

Ran


2 Answers

Found it. I should have used R.layout.sherlock_spinner_dropdown_item for the spinner.

like image 137
Ran Avatar answered Nov 02 '22 22:11

Ran


Are you setting the correct dropdown items?:

getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
navigationItems = Arrays.asList(getResources().getStringArray(R.array.navigation_array));
setupNavigationStrings();
navigationAdapter = new ArrayAdapter<String>(context, com.actionbarsherlock.R.layout.sherlock_spinner_item, navigationItems);
navigationAdapter.setDropDownViewResource(com.actionbarsherlock.R.layout.sherlock_spinner_dropdown_item);
getSupportActionBar().setListNavigationCallbacks(navigationAdapter, this);
like image 30
Iñigo Avatar answered Nov 02 '22 22:11

Iñigo