There\'s been many questions on styling on action bars, but the ones I\'ve found either are relating to styling the tabs, or have answers that don\'t work for me.
Th
I did this way:
<style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
<item name="colorPrimary">@color/colorPrimary</item>
<item name="colorPrimaryDark">@color/colorPrimaryDark</item>
<item name="colorAccent">@color/colorAccent</item>
<item name="actionMenuTextAppearance">@style/MenuTextAppearance</item>
<item name="android:actionMenuTextAppearance">@style/MenuTextAppearance</item>
<item name="actionMenuTextColor">@color/colorAccent</item>
</style>
<style name="MenuTextAppearance" >
<item name="android:textAppearance">@android:style/TextAppearance.Large</item>
<item name="android:textSize">20sp</item>
<item name="android:textStyle">bold</item>
</style>
You have to change
<style name="MyActionBar.MenuTextStyle"
parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
to
<style name="MyActionBar.MenuTextStyle"
parent="android:style/TextAppearance.Holo.Widget.ActionBar.Menu">
as well. This works for me.
Instead of having the android:actionMenuTextAppearance
item under your action bar style, move it under your app theme.
I think the code below
<item name="android:actionMenuTextAppearance">@style/MyActionBar.MenuTextStyle</item>
must be in MyAppTheme
section.
BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
TextView textView = (TextView) navigation.findViewById(R.id.navigation_home).findViewById(R.id.smallLabel);
textView.setTypeface(Typeface.DEFAULT_BOLD);
textView = (TextView) navigation.findViewById(R.id.navigation_home).findViewById(R.id.largeLabel);
textView.setTypeface(Typeface.DEFAULT_BOLD);
My guess is that you have to also style the views that are generated from the menu information in your onCreateOptionsMenu(). The styling you applied so far is working, but I doubt that the menu items, when rendered with text use a style that is the same as the title part of the ActionBar.
You may want to look at Menu.getActionView() to get the view for the menu action and then adjust it accordingly.