student
student

Reputation: 25

Spinner arrow color not changed

I have created a custom toolbar which has a spinner. I am trying to set a custom colour for the spinner arrow - currently the default is white, but it's not working, any ideas?

This is my Toolbar layout:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/newToolbar"
    android:layout_width="match_parent"
    android:layout_height="?attr/actionBarSize"
    android:background="@color/colorPrimary"
    android:elevation="0dp"
    android:windowContentOverlay="@null"
    android:orientation="horizontal">

    <ImageView
        android:id="@+id/strLogo"
        android:layout_width="45dp"
        android:layout_height="40dp"
        android:layout_marginTop="13dp"
        android:scaleType="fitCenter"
        android:visibility="gone"
        android:background="#ffffff"
        android:src="@mipmap/logo"/>

    <TextView
        android:id="@+id/updateName"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:gravity="left|center_vertical"
        android:layout_toRightOf="@+id/strLogo"
        android:layout_centerVertical="true"
        android:text="Test"
        android:visibility="visible"
        android:textColor="#ffffff"
        android:textAppearance="?android:attr/textAppearanceMedium"
        android:textStyle="normal" />

    <Spinner
        android:id="@+id/spinner_nav"
        android:layout_width="150dp"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_centerVertical="true"
        style="@style/customSpinnerTheme"
        android:visibility="visible"/>

</RelativeLayout>

This my style xml for the spinner:

<style name="customSpinnerTheme" parent="ThemeOverlay.AppCompat">
    <item name="colorControlActivated">#FFFFFF</item>
    <item name="colorControlHighlight">#FFFFFF</item>
</style>

Upvotes: 0

Views: 590

Answers (1)

Krishna Kachhela
Krishna Kachhela

Reputation: 793

You can add this type of style in your spinner style and add your colors which you want to use as your drawable:

<style name="SpinnerAppTheme" parent="android:Widget.Spinner">
  <item name="android:background">@drawable/apptheme_spinner_background_holo_light</item>
  <item name="android:dropDownSelector">@drawable/apptheme_list_selector_holo_light</item>
</style>

Upvotes: 1

Related Questions