Android Spinner Underline color

I can add underline in spinner using style="@style/Base.Widget.AppCompat.Spinner.Underlined". How can I change color of underline using style only? I dont want to use any drawable file to change this.

 <item name="colorControlHighlight">@color/colorAccent</item>
 <item name="colorControlNormal">@color/colorAccent</item>

Using above style, Its only highlight underline when user click on it. Its not changing color of underline on normal state.

  • Integrating videolan in Android for live streaming
  • Store application global data
  • Android SharedPreferences update does not work
  • What is your workflow for testing Cloud Code on Parse?
  • Android: How to make game asset files readable from c++ code using ndk
  • moving android SDK installation folder
  • Related posts:

    Keyboard navigation with Android GridView doesn&#039;t scroll grid
    getting an error in webview on ice cream sandwich
    Get language name in that language from language code
    What does postInvalidate() do?
    How to convert a pdf to an image?
    consuming WCF web service from android application?
  • How to run an android app on the device with ant
  • Android best practice - views/activities
  • Android+Facebook: where are API KEY and API SECRET used?
  • Store Android SQLite
  • Protect from fake reviews on Google Play
  • Android Bluetooth Low Energy Pairing
  • One Solution collect form web for “Android Spinner Underline color”

    By default the Spinner will use the color set via android:textColorSecondary or colorControlNormal in your AppTheme. So either set the appropriate colors there or define a new Theme and apply this one to your Spinner:

    Example:

    styles.xml

    <style name="ThemeSpinner">
        <!-- Color when pressed -->
        <item name="colorAccent">#ffa000</item>
        <!-- Default color for the dropdown arrow and line -->
        <item name="colorControlNormal">#ffc107</item>
    </style>
    

    layout.xml

    <Spinner
        style="@style/Widget.AppCompat.Spinner.Underlined"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:theme="@style/ThemeSpinner" />
    

    Note: The dropdown arrow will also be tinted – I’m not aware of an option to color the arrow separately

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.