How to style Android Spinner with a material light theme on a dark background?

I can’t figure out how to style this counter in a dark background drawer with v21 Material theme. I tried various approaches related to user styles, and nothing seems to have anything to do with the appearance of this counter.

Here's what it looks like in an application running on Android 5.0.1. Spinner, with Code on the Beach 2015 selected here, is in a box with a dark background (# DD000000), but the rest of the application is a light theme. The arrow shows as black - it is almost impossible to see on the device. I wish he had a white arrow.

App screenshots

Here is my styles.xml file:

<?xml version="1.0" encoding="UTF-8" ?>
<resources>
    <style name="app_theme" parent="Theme.AppCompat.Light">
        <item name="colorPrimary">#E95624</item>
        <item name="colorPrimaryDark">#BD4000</item>
        <item name="colorAccent">#86d3c5</item>
        <item name="windowActionBar">false</item>
    </style>
</resources>

And here is the Main.axml file, the main layout for this action, containing DrawerLayout and Spinner:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:a="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    a:layout_width="match_parent"
    a:layout_height="match_parent"
    a:orientation="vertical">
    <android.support.v7.widget.Toolbar
        a:id="@+id/main_toolbar"
        a:layout_width="match_parent"
        a:layout_height="wrap_content"
        a:minHeight="?attr/actionBarSize"
        a:background="?attr/colorPrimary"
        a:elevation="2dp"
        app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
        app:popupTheme="@style/ThemeOverlay.AppCompat.Light">
    </android.support.v7.widget.Toolbar>
    <android.support.v4.widget.DrawerLayout
        a:id="@+id/drawer_layout"
        a:layout_width="match_parent"
        a:layout_height="match_parent">
        <FrameLayout
            a:id="@+id/content_frame"
            a:layout_width="match_parent"
            a:layout_height="match_parent" />
        <LinearLayout
            a:id="@+id/left_drawer"
            a:orientation="vertical"
            a:layout_width="240dp"
            a:layout_height="match_parent"
            a:layout_gravity="start"
            a:background="#DD000000">
            <Spinner
                a:id="@+id/event_spinner"
                a:layout_width="match_parent"
                a:layout_height="wrap_content"
                a:padding="4dp" />
            <ListView
                a:id="@+id/left_drawer_list"
                a:layout_width="match_parent"
                a:layout_height="wrap_content"
                a:choiceMode="singleChoice"
                a:divider="@android:color/transparent"
                a:dividerHeight="0dp" />
        </LinearLayout>
    </android.support.v4.widget.DrawerLayout>
</LinearLayout>

, , , (Xamarin #):

var adapter = new ArrayAdapter<string>(SupportActionBar.ThemedContext, Resource.Layout.event_selector, events);
  adapter.SetDropDownViewResource(global::Android.Resource.Layout.SimpleSpinnerDropDownItem);

_eventSelector.Adapter = adapter;

event_selector.axml( textColor #fff , ):

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:padding="8dp"
    android:textSize="16sp"
    android:textColor="#fff" />

.axml styles.xml , ? !

+4
1

backgroundTint .

    <Spinner
      a:id="@+id/event_spinner"
      a:layout_width="match_parent"
      a:layout_height="wrap_content"
      a:padding="4dp" 
      a:backgroundTint="#FFFFFF"/>
0

All Articles