I am currently working ActionBar (ActionBarCompat) oriented project, I Need some Clarification about actionbar.
I am using spinner layout like this,
<
I feel it's time to start migrating from ABS to ABC easily by ActionBarCompat library!
Solution for spinner (Dropdown list) using ActionBarCompat library
private void setupSpinner(MenuItem item) {
// item.setVisible(getSupportActionBar().getNavigationMode() == ActionBar.NAVIGATION_MODE_LIST);
item.setVisible(ab.getNavigationMode() == ActionBar.NAVIGATION_MODE_LIST);
View view = item.getActionView();
Context context = ab.getThemedContext(); //to get the declared theme
if (view instanceof Spinner) {
Spinner spinner = (Spinner) view;
ArrayAdapter listAdapter =ArrayAdapter.createFromResource(context,
R.array.spinner_data,
R.layout.support_simple_spinner_dropdown_item);
listAdapter.setDropDownViewResource(R.layout.support_simple_spinner_dropdown_item);
spinner.setAdapter(listAdapter);
}
make sure you have added following in style.xml: