I have the following layout in my application:
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:fitsSystemWindows="true"
app:expanded="false">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="?attr/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="48dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/header_image"
android:layout_width="match_parent"
android:layout_height="150dp"
android:contentDescription="@string/app_name"
android:fitsSystemWindows="true"
app:layout_collapseMode="parallax" />
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_collapseMode="pin">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
Also application theme is as following
<style name="Theme.MyApp" parent="Theme.AppCompat.Light.NoActionBar">
<item name="colorPrimary">@color/primary</item>
<item name="colorPrimaryDark">@color/primary_dark</item>
<item name="colorAccent">@color/accent</item>
<item name="android:windowIsTranslucent">true</item>
</style>
Where colors are:
<color name="primary">#5677fc</color>
<color name="primary_dark">#303f9f</color>
<color name="accent">#e040fb</color>
To set title I use
CollapsingToolbarLayout collapsingToolbar;
...
collapsingToolbar.setTitle(title);
Title shown black, I what it white. How can I do it?
Both setting app:titleTextColor="@android:color/white"
to Toolbar
and toolbar.setTitleTextColor(0xffffff);
does not help.