Search code examples
androidandroid-actionbaractionbarsherlock

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


Solution

  • 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);