1. First find the theme of the application or activity that needs to be modified in AndroidManifest.xml
2. Rewrite actionBarStyle in the theme that needs to be modified.
3. Add the style of actionbarStyle
But how do we know what the parent should inherit at this time? This requires following the clue.
Follow the parent of the AppTheme of the application and touch the place where actionbarStyle is.
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Settings">
<style name="Theme.DeviceDefault.Settings" parent="Theme.Material.Settings">
Finally, you can find the corresponding actionbarStyle in this class
<style name="Theme.Material">
So the parent can inherit the style I framed in red, and the same goes for the parent of MyTitleTextStyle.
4. Modify the font of actionbar
Note that the name here is "android:textSize", not "textSize"
Attach the code block at the end
<style name="AppTheme" parent="@android:style/Theme.DeviceDefault.Settings">
<item name="android:windowNoTitle">false</item>
<item name="android:windowContentOverlay">@null</item>
<item name="android:windowAnimationStyle">@style/Animation</item>
<item name="android:actionBarStyle">@style/MyActionBarStyle</item>
</style>
<style name="MyActionBarStyle" parent="@android:style/Widget.Material.ActionBar.Solid">
<item name="android:titleTextStyle">@style/MyTitleTextStyle</item>
</style>
<style name="MyTitleTextStyle" parent="@android:style/TextAppearance.Material.Title">
<item name="android:textSize">25dp</item>
</style>