0

I'm currently trying to set the font weight of my ActionBar title to bold, with the following code, but it isn't working as expected. What am i doing wrong?

<style name="dActionBar" parent="@android:style/Widget.Holo.ActionBar">
        <item name="android:background">#DDDDDD</item>
        <item name="android:textColor">#FFFFFF</item>
        <item name="android:textStyle">bold</item>
        <item name="android:foreground">#000000</item>
    </style>

The background color and so on is working pretty well.

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140
Lukas
  • 1,346
  • 7
  • 24
  • 49

1 Answers1

1

not all Android fonts have bold style,for example Chinese words must use setFakeBoldText

        final int actionBarTitle = getResources().getIdentifier("action_bar_title", "id", "android");
        final TextView title = (TextView) getActivity().getWindow().findViewById(actionBarTitle);
        title.getPaint().setFakeBoldText(true);
Jiang Qi
  • 4,450
  • 3
  • 19
  • 19
  • This worked for me. The strange thing is, that the content of the title was just a normal english word. Although it works now :) Thanks! – Lukas Sep 22 '13 at 14:09