Change color the title of the AppBar

3

please I need help I can not change the color of the title of the appBar, in mine it turns black and I would like to change it white .. in this case I am using a toolbar try it with everything I put <item name="colorAccent">#FFFFFF</item> the accent to myma but does not change it .. I also did it by code toolbar.setTitleTextColor(Color.parseColor("#FFFFFF")); I did not change it and I also did it by xml but none works.

    
asked by Gunnar 30.03.2016 в 13:48
source

1 answer

4

use setTitleTextColor() ,

Defining the color hex, for example

toolbar.setTitleTextColor(0xFF00FF00);

Here it is important to add the Alpha (transparency), because if you do not have it, you may have problems changing the color of a previously defined one.

A defined color can be loaded in the SDK:

toolbar.setTitleTextColor(Color.GREEN);

You can also load a hex code into string and pause it to convert it to Color:

toolbar.setTitleTextColor(Color.parseColor("#00FF00"));

    
answered by 30.03.2016 / 17:49
source