原文地址:
https://stackoverflow.com/a/29536902
https://stackoverflow.com/a/27754099
[your_layout.xml]
1 | <android.support.v7.widget.Toolbar |
Styles / Themes in styles.xml
1 | <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar"> |
Result
Note: I made the checkbox purple for demo purpose
Change arrow color of Spinner
In styles.xml, add the following style:
1
2
3
4
5
6
7
8<style name="ActionBarThemeOverlay" parent="">
<item name="android:textColorPrimary">#ffffff</item>
<item name="colorControlNormal">#ffffff</item>
<item name="colorControlHighlight">#ff33b5e5</item>
</style>
<style name="Widget.MyTheme.HeaderBar.Spinner" parent="Widget.AppCompat.Light.Spinner.DropDown.ActionBar">
<item name="android:theme">@style/ActionBarThemeOverlay</item>
</style>In the layout, where you use the Spinner (in your case with Toolbar), add the style to your spinner:
1
2
3
4
5
6<Spinner
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/my_spinner"
style="@style/Widget.MyTheme.HeaderBar.Spinner"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />