Light.DarkActionBar menu item text colour unchangeable?

后端 未结 6 1058
轻奢々
轻奢々 2021-02-01 19:34

The application I\'ve been developing uses ActionBarSherlock, and the main theme inherits from Theme.Sherlock.Light.DarkActionBar. The design requires that the overflow menu pop

6条回答
  •  甜味超标
    2021-02-01 19:52

    I found the solution, use:

    getSupportActionBarContext()
    

    e.g.

    ArrayAdapter list =
                ArrayAdapter.createFromResource(getSupportActionBarContext(), R.array.navigation, layout.simple_spinner_item);
        list.setDropDownViewResource(layout.simple_spinner_dropdown_item);
    
        getSupportActionBar().setNavigationMode(ActionBar.NAVIGATION_MODE_LIST);
        getSupportActionBar().setListNavigationCallbacks(list, this);
    

提交回复
热议问题