0

Activity:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/activity_main"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    tools:context="com.example.andre.myapplication.MainActivity">

    <android.support.v7.widget.Toolbar
        android:id="@+id/toolbar"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/colorPrimary"
        android:minHeight="?attr/actionBarSize"
        style="@style/ToolbarTheme">



    </android.support.v7.widget.Toolbar>

</LinearLayout>

styles.xml:

<resources>

    <!-- Base application theme. -->
    <style name="AppTheme" parent="Theme.AppCompat.Light.NoActionBar">
        <!-- Customize your theme here. -->
        <item name="colorPrimary">@color/colorPrimary</item>
        <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
        <item name="colorAccent">@color/colorAccent</item>
    </style>

    <style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Light">
        <item name="android:textColorPrimary">@android:color/white</item>
        <item name="android:textColorSecondary">@android:color/white</item>
        <item name="android:textColor">@android:color/white</item>
    </style>

</resources>

But I still have balck title on Toolbar. Why ?

Andrii Omelchenko
  • 13,183
  • 12
  • 43
  • 79
ceth
  • 44,198
  • 62
  • 180
  • 289
  • You should change your custom ToolbarTheme's parent. Take a look at [this answer](http://stackoverflow.com/a/39344517/5392118). – Burak Cakir Nov 04 '16 at 11:19
  • try `app:titleTextColor="@android:color/white"` and more styling info @ http://www.materialdoc.com/toolbars/ – Raghunandan Nov 04 '16 at 11:21

2 Answers2

0

Hi try setting the textColor directly to the toolbar. if it works , there is something strange going on in the theme

Sajidh Zahir
  • 526
  • 4
  • 13
0
<style name="ToolbarTheme" parent="ThemeOverlay.AppCompat.Dark.ActionBar"/>

This works for me when I want white title in toolbar

Giannis
  • 121
  • 2
  • 4
  • 13