0

Here are the specs for my android platform from my Build.gradle script for my application

classpath 'com.android.tools.build:gradle:2.3.3'
compileSdkVersion 26
buildToolsVersion "26.0.1"
minSdkVersion 21
targetSdkVersion 26
versionCode 1
versionName "1.0"

Below is the style i included in my STYLES.XML file:

<style name="customStyle" parent="@style/Theme.AppCompat.Light.DarkActionBar">
        <item name="actionBarStyle">@style/customActionBarStyle</item>
    </style>

    <style name="customActionBarStyle" parent="@style/Widget.AppCompat.Light.ActionBar.Solid.Inverse">
        <item name="background">@drawable/custom</item>
        <item name="titleTextColor">#01579B</item>
    </style>

Please can any one briefly help with how to set the title text color on the action bar. Thank you.

<item name="titleTextColor">#01579B</item>
Zoe
  • 27,060
  • 21
  • 118
  • 148
semilogo97
  • 125
  • 1
  • 2
  • 11

1 Answers1

0

add this item your ActionBar style templet

<item name="android:textColor">@color/red</item>

or

int actionBarTitleId = Resources.getSystem().getIdentifier("action_bar", "id", "android");
if (actionBarTitleId > 0) {
    TextView title = (TextView) findViewById(actionBarTitleId);
    if (title != null) {
        title.setTextColor(Color.RED);
    }
}
Sabbir Ahmed
  • 351
  • 1
  • 13