title: Android spinner custom layout
body: <p>I am trying to customize my spinner with custom style.</p>
  <p><strong>Spinner</strong></p>
  <pre><code>&lt;Spinner
              android:id=&quot;@+id/my_spinner&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_marginBottom=&quot;@dimen/activity_vertical_margin&quot;
              android:layout_marginLeft=&quot;@dimen/activity_horizontal_margin&quot;
              android:layout_marginRight=&quot;@dimen/activity_horizontal_margin&quot;
              android:layout_marginTop=&quot;@dimen/activity_vertical_margin&quot;
              app:layout_constraintTop_toBottomOf=&quot;@id/expense_amount&quot;
              app:layout_constraintLeft_toRightOf=&quot;parent&quot;
              app:layout_constraintRight_toLeftOf=&quot;parent&quot;
              android:elevation=&quot;3dp&quot;
              /&gt;
  </code></pre>
  <p>Here is my styles.xml file.</p>
  <p><strong>styles.xml</strong></p>
  <pre><code>&lt;style name=&quot;AppTheme&quot; parent=&quot;Theme.AppCompat.Light.DarkActionBar&quot;&gt;
      &lt;item name=&quot;android:spinnerStyle&quot;&gt;@style/AppTheme.spinnerStyle&lt;/item&gt;
      &lt;item name=&quot;android:spinnerDropDownItemStyle&quot;&gt;@style/AppTheme.spinnerDropDownItemStyle&lt;/item&gt;
  
  &lt;/style&gt;
  &lt;style name=&quot;AppTheme.spinnerStyle&quot; parent=&quot;@android:style/Widget.Material.Light.Spinner&quot;&gt;
      &lt;item name=&quot;android:textColor&quot;&gt;@android:color/white&lt;/item&gt;
      &lt;item name=&quot;android:background&quot;&gt;@color/colorPrimary&lt;/item&gt;
  
  &lt;/style&gt;
  &lt;style name=&quot;AppTheme.spinnerDropDownItemStyle&quot; parent=&quot;@android:style/Widget.Material.DropDownItem.Spinner&quot;&gt;
      &lt;item name=&quot;android:textColor&quot;&gt;@android:color/white&lt;/item&gt;
      &lt;item name=&quot;android:background&quot;&gt;@color/colorPrimary&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  <p>This gives me spinners that look like this:
  <a href="https://i.stack.imgur.com/mvKS6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mvKS6.png" alt="Spinner Image" /></a></p>
  <p>I want to add a dropdown arrow.
  When I change the spinner to code for dropdown arrow, all the textcolor and background color are lost.</p>
  <p><strong>Spinner code to show dropdown arrow</strong></p>
  <pre><code>&lt;Spinner
              android:id=&quot;@+id/my_spinner&quot;
              android:layout_width=&quot;wrap_content&quot;
              android:layout_height=&quot;wrap_content&quot;
              android:layout_marginBottom=&quot;@dimen/activity_vertical_margin&quot;
              android:layout_marginLeft=&quot;@dimen/activity_horizontal_margin&quot;
              android:layout_marginRight=&quot;@dimen/activity_horizontal_margin&quot;
              android:layout_marginTop=&quot;@dimen/activity_vertical_margin&quot;
              app:layout_constraintTop_toBottomOf=&quot;@id/expense_amount&quot;
              app:layout_constraintLeft_toRightOf=&quot;parent&quot;
              app:layout_constraintRight_toLeftOf=&quot;parent&quot;
              android:background=&quot;@android:drawable/btn_dropdown&quot;
              /&gt;
  </code></pre>
  <p><a href="https://i.stack.imgur.com/GjEEA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GjEEA.png" alt="Spinner with dropdown arrow" /></a></p>
  <p>How can I retain my theme along with the drop down arrow ??</p>
  <p><strong>P.S.</strong> I am not very good at capturing screenshots on linux machines.</p>