1

I use Android support library 23.0.1. I want to style Base.Widget.AppCompat.Spinner.DropDown.ActionBar and Base.Widget.AppCompat.DrawerArrowToggle. What support do I add to enable these widgets?

Sandah Aung
  • 6,156
  • 15
  • 56
  • 98

1 Answers1

1

I suggest that you use a Toolbar. A toolbar is basically a ViewGroup and emulates most (if not more) of the functionalities of the ActionBar.

To include a spinner:

<android.support.v7.widget.Toolbar
       android:id="@+id/toolbar"
       android:layout_width="match_parent"
       android:layout_height="wrap_content">

       <Spinner
           android:layout_width="wrap_content"
           android:layout_height="wrap_content"/>

</android.support.v7.widget.Toolbar>

Reference: http://android-developers.blogspot.cl/2014/10/appcompat-v21-material-design-for-pre.html

As for the arrow toggle, take a look at this: How to implement DrawerArrowToggle from Android appcompat v7 21 library

Basically you'll need to create this style:

<style name="AppTheme" parent="Theme.AppCompat.Light">
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>

<style name="DrawerArrowStyle" parent="Widget.AppCompat.DrawerArrowToggle">
    <item name="spinBars">true</item>
    <item name="color">@android:color/white</item>
</style>

And do some initialization on your onCreate.

Community
  • 1
  • 1
jlhonora
  • 10,179
  • 10
  • 46
  • 70