I'm trying to style a custom spinner in dialog mode, but whatever I do I can't get rid of the white background.
This is my spinner.
<androidx.appcompat.widget.AppCompatSpinner
android:id="@+id/mySpinner"
android:layout_width="match_parent"
android:layout_height="?attr/dropdownListPreferredItemHeight"
android:layout_margin="16dp"
android:background="@drawable/background_dropdown"
android:spinnerMode="dialog"
/>
The items in my spinner all have a transparent background, as I don't want a background for each item, but one for the whole dialog. I found out I can set a background for all items, by overriding android:listViewStyle in my theme:
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:listViewStyle">@style/myListView</item>
</style>
<style name="myListView" parent="@android:style/Widget.ListView">
<item name="android:background">@drawable/background_dropdown</item>
</style>
But even after that, there is still another background behind the list. I guessed it's from the dialog the spinner uses, so I added android:alertDialogStyle to my theme.
<style name="AppTheme.Base" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:listViewStyle">@style/myListView</item>
<item name="android:alertDialogStyle">@style/myDialog</item>
</style>
<style name="myDialog">
<item name="android:background">@android:color/transparent</item>
</style>
but it made no difference. How do I get rid of this white background in the corners?