I want to change popupBackground color of my dialog spinner.
In my activity.xml
:
<Spinner
android:id="@+id/mCategorySpinner"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_toRightOf="@id/textView7"
android:entries="@array/recipeCategory"
android:spinnerMode="dialog"
android:popupBackground="@color/colorPrimary"
android:textAlignment="center" />
In my activity.java
:
categorySpinner=(Spinner) findViewById(R.id.mCategorySpinner);
ArrayAdapter<CharSequence> adapter = ArrayAdapter.createFromResource(this, R.array.recipeCategory, android.R.layout.simple_spinner_item);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
categorySpinner.setPrompt("Choose category");
categorySpinner.setAdapter(new NothingSelectedSpinnerAdapter(
adapter,
R.layout.category_spinner_row_nothing_selected,
this));
Nothing happens if I change android:popupBackground
in XML,it remains the default white.
But if I change background it works, but it's not for dialog's background.