0

I'm trying to change the background and title color of the toolbar on Android 10.

In the xml file, I have the following (in style):

<item name="colorPrimary">@color/C_Yellow</item>
<item name="toolbarStyle">@style/CustomStyle</item>

(in resources):

<style name="CustomStyle" parent="Widget.AppCompat.Toolbar">
    <item name="titleTextColor">@color/B_Blue</item>
</style>

It works on Android 4.4; however, on Android 10, it just has a black background with white text.

What should I do in order to change both background and title color on Android 10?

David Lee
  • 665
  • 7
  • 20
  • Are you using a toolbar in your layout? where is @style/CustomStyle ? – Gabriele Mariotti Mar 28 '21 at 12:31
  • I tried putting it in the **xml** file but it shows me two toolbars (the upper one is the default one which has black background and the lower one is the one I made with a background color I want). – David Lee Mar 29 '21 at 02:05

1 Answers1

0

Just use android:foregroundTint for text color and icons if present, secondly for background use android:background and set color according to your choice