这就是我所做的。我无法将CustomActionBar主题应用于NoActionBar活动,但我需要自定义工具栏。
<!-- Base application theme. -->
<style name="AppTheme" parent="@style/Theme.AppCompat.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="android:actionBarStyle">@style/CustomActionBarTheme</item>
</style>
<!-- the theme applied to the application or activity -->
<style name="Toolbar_Theme">
<item name="colorControlNormal">@android:color/black</item>
<item name="android:textColor">#000000</item>
<item name="android:titleTextStyle">@style/TitleBarTextColor</item>
</style>
<style name="TitleBarTextColor" parent="@style/TextAppearance.AppCompat.Widget.ActionBar.Title">
<item name="android:textColor">#ffffff</item>
</style>
<color name="custom_color">#8C000000</color>
<style name="CustomActionBarTheme"
parent="@android:style/Theme.Holo">
<item name="android:icon">@android:color/transparent</item>
<item name="android:windowActionBarOverlay">true</item>
<!-- Support library compatibility -->
</style>