I tried other solutions on Stack Overflow but those are for older versions of Android Studio. In Android Studio 4.1.1, there is "color.xml" instead of "styles.xml." That's why the older solutions didn't work for me.
Asked
Active
Viewed 46 times
0
-
`color.xml` does not replace `styles.xml` I am sure you can add `styles.xml` in values folder and you can make your changes there. – noname Dec 18 '20 at 11:32
-
4Does this answer your question? [Set title background color](https://stackoverflow.com/questions/2251714/set-title-background-color) – noname Dec 18 '20 at 11:33
-
Please add links to the solutions you tried – fdermishin Dec 18 '20 at 13:08
1 Answers
0
You can use something like this:
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
toolbar.setTitle("Hello");
toolbar.setTitleTextColor(Color.RED);//for red colored toolbar title
Usama Altaf
- 1,036
- 1
- 4
- 23