0
<style name="MyActionBarTheme" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="android:titleTextAppearance">@style/MyActionBarTitleText</item>
        <!-- Support library compatibility -->
        <item name="titleTextAppearance">@style/MyActionBarTitleText</item>

I am getting following error for titleTextAppearance for support library

error: Error: No resource found that matches the given name: attr 'titleTextAppearance'

I need to change text size and typeface/font for title on ActionBar. I could change the font using link but can not change the text size. So how do I change text size and how can I get titleTextAppearance on support library ?

Community
  • 1
  • 1
T_C
  • 3,148
  • 5
  • 26
  • 46

1 Answers1

1

Although I haven't tested it with @style/Theme.AppCompat.Light.DarkActionBar as parent theme, I've used titleTextStyle instead of titleTextAppearance before as follows with @android:style/Widget.Holo.Light.ActionBar" as parent theme. You can give it a try:

<style name="MyActionBarTheme" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:titleTextStyle">@style/MyActionBarTitleText</item>
</style>

<style name="MyActionBarTitleText" parent="android:style/TextAppearance.Holo.Widget.ActionBar.Title">
     <item name="android:textSize">25sp</item>    
</style>

Let me know if it helps.

Shobhit Puri
  • 25,769
  • 11
  • 95
  • 124
  • I have tried `titleTextStyle `, but it doesn't change the textzise – T_C Nov 14 '14 at 02:06
  • what parent should I use so that it has `titleTextAppearance ` – T_C Nov 14 '14 at 02:13
  • Well, I don't know about that. However I have edited my answer to add `25sp ` in the `MyActionBarTitleText`. Maybe give it a short and see if it changes the text size. – Shobhit Puri Nov 14 '14 at 02:21