I want to change the font style, font size and positioning of the app name in my action bar to more to the centre, in android studio. I can’t find anything when looking up how to do this on the internet. Does anyone know how this is done? My app name is located in my String.xml file. This is currently the only line of code in this file:
<resources>
<string name="app_name">TestApp</string>
</resources>
In which file in my app do I add the code to change these characteristics regarding the app name in the actionbar at the top of the page and what is that code I need?
2
Answers
Go to the
styles.xml
and add this code:and then when you do that go to the
AndroidManifest.xml
and add this code:Finally in your java file add this:
I hope this helps you and answer your question. Please let me know if you have any problem.
The more efficient way would be to remove the default status bar from your theme and create a custom toolbar. This way, you will create a toolbar according to your design.
In themes.xml
change this-
to this-
Then in your XML layout design your own toolbar.