0

This is my style.xml for now its showing Action Bar Text in black color, if am changing android:titleTextStyle its changing the text color of listView AND many other thing, how can i solve this ? i want Action bar title color in white and others in black.

<style name="MyTheme" parent="Theme.AppCompat.Light">
    <!-- Customize your theme here. -->
    <item name="colorPrimary">@color/myPrimaryColor</item>
    <item name="colorPrimaryDark">@color/myPrimaryDarkColor</item>
    <item name="colorAccent">@color/myAccentColor</item>
    <item name="android:titleTextStyle">@color/myWindowBackground</item>
    <item name="android:textColorPrimary">@color/myTextPrimaryColor</item>
    <item name="android:navigationBarColor">@color/myNavigationColor</item>
    <item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
    <item name="android:windowBackground">@color/myWindowBackground</item>
    <item name="android:windowContentTransitions">true</item>
</style>
  • you want to change ActionBar title color runtime?? – Amol Sawant Sep 07 '15 at 05:17
  • There are many solutions already given to this issue. http://stackoverflow.com/questions/5861661/actionbar-text-color – Kaveesh Kanwal Sep 07 '15 at 05:20
  • @KaveeshKanwal your link is invalid, it is on Holo Theme not AppCompat – Derek Fung Sep 07 '15 at 05:31
  • possible duplicate of [Change ActionBar title text color using Light.DarkActionBar theme in AppCompat 21](http://stackoverflow.com/questions/26870698/change-actionbar-title-text-color-using-light-darkactionbar-theme-in-appcompat-2) – Derek Fung Sep 07 '15 at 05:38
  • The link is not invalid, it is working. And if you know what theme you are using you can always make the desired changes. Nothing is ever on a platter my friend. Good luck. – Kaveesh Kanwal Sep 07 '15 at 05:43
  • you all mean to say that i have to change full style of my project. Right ? –  Sep 08 '15 at 04:21

1 Answers1

1

use this on styles.xml :

<?xml version="1.0" encoding="utf-8"?>
<resources>
  <style name="AppTheme" parent="@android:style/Theme.Holo.Light">
    <item name="android:actionBarStyle">@style/AppTheme.ActionBarStyle</item>
  </style>

  <style name="AppTheme.ActionBarStyle" parent="@android:style/Widget.Holo.Light.ActionBar">
    <item name="android:titleTextStyle">@style/AppTheme.ActionBar.TitleTextStyle</item>
  </style>

  <style name="AppTheme.ActionBar.TitleTextStyle" parent="@android:style/TextAppearance.Holo.Widget.ActionBar.Title">
    <item name="android:textColor">@color/blue</item>
  </style>
</resources>
N Kaushik
  • 2,198
  • 18
  • 29
  • i asked for some modification in my code, i dont want to change whole code because this is a big project. –  Sep 08 '15 at 04:19