This custom font is actually related to Actionbar, but did not consider the changes in the font style before writing Ationbar, today, see an article specifically written on the use of the way. ╮(╯▽╰)╭, have to say that the style of Actionbar is really a headache, obviously can be specified with a graphical interface.
Add the following code to the res/values/styles.xml file
<stylename= "Myactivitytheme"Parent= "Android:Theme.Light" > <Itemname= "Android:windowtitlebackgroundstyle">@style/windowtitlebackgroundstyle</Item> <Itemname= "Android:windowtitlestyle">@style/windowtitlestyle</Item> <!--Window Header Height - <Itemname= "Android:windowtitlesize">54dp</Item> </style> <!--Preference Settings Window Title - <stylename= "Windowtitlebackgroundstyle"> <Itemname= "Android:background">#CCE8CF</Item> </style> <stylename= "Windowtitlestyle"> <Itemname= "Android:textcolor">#FF0000</Item> <Itemname= "Android:paddingleft">25dp</Item> <Itemname= "Android:textsize">20sp</Item> </style>
The next thing you can do is use this theme for your activity.
< Activity Android:name = "Com.example.stylewindowtitle.MainActivity" android:label= "@string/app_name" android:theme= "@style/ Myactivitytheme ">
Android Custom title bar font