Android custom spinner with theme
<p>I am trying to customize my spinner with theme attribute.
Here is my spinner item layout</p>
<pre><code>&lt;TextView xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;
    style=&quot;@style/DashboardSpinnerItemStyle&quot;
    android:layout_width=&quot;match_parent&quot;
    android:layout_height=&quot;wrap_content&quot;
    android:ellipsize=&quot;marquee&quot;
    android:singleLine=&quot;true&quot;
    android:text=&quot;test&quot;
    android:textSize=&quot;@dimen/material_text_body1&quot; /&gt;
</code></pre>
<p>I use custom style</p>
<pre><code>&lt;style name=&quot;DashboardSpinnerItemStyle&quot; parent=&quot;Widget.AppCompat.TextView.SpinnerItem&quot;&gt;
    &lt;item name=&quot;android:textColor&quot;&gt;?dashboard_color&lt;/item&gt;
    &lt;item name=&quot;android:background&quot;&gt;#00F&lt;/item&gt;
&lt;/style&gt;
</code></pre>
<p>There is attribute color which determined in my theme</p>
<pre><code>&lt;style name=&quot;WhiteDashboardTheme&quot; parent=&quot;Theme.AppCompat.Light.NoActionBar&quot;&gt;
    &lt;item name=&quot;android:textColor&quot;&gt;@android:color/white&lt;/item&gt;
    &lt;item name=&quot;dashboard_shape&quot;&gt;@drawable/dashboard_center_shape_white&lt;/item&gt;
    &lt;item name=&quot;dashboard_color&quot;&gt;@android:color/white&lt;/item&gt;
    &lt;item name=&quot;spinner_background&quot;&gt;@drawable/dashboard_spinner_white&lt;/item&gt;
    &lt;item name=&quot;dashboard_spinner_item_style&quot;&gt;@style/DashboardSpinnerItemStyle&lt;/item&gt;
&lt;/style&gt;
</code></pre>
<p><a href="https://i.stack.imgur.com/wJE5V.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wJE5V.png" alt="enter image description here" /></a></p>
<p>works fine, but emulator or real device goes throws an exception</p>
<blockquote>
<p>04-28 09:01:44.909 2460-2460/com.amocrm.prototype E/AndroidRuntime: FATAL EXCEPTION: main                                                  android.view.InflateException: Binary XML file line #2: Error inflating class TextView</p>
</blockquote>
<p>What I am doing wrong?</p>