I'm trying to change the textcolor in toolbar to white but the color wont change.
Things i've tried:
1- Changing the app:theme=app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
2- trying to do it programmatically: toolbar.setTitleTextColor(0xFFFFFFFF);
3- The last one which code appears under:
Custom style: ToolBarstyle:
Res/style
<style name="ToolBarStyle" parent="Theme.AppCompat">
<item name="android:textColorPrimary">@android:color/white</item>
<item name="android:textColorSecondary">@android:color/white</item>
<item name="actionMenuTextColor">@android:color/white</item>
<item name="drawerArrowStyle">@style/DrawerArrowStyle</item>
</style>
Res/Layout
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:theme="@style/ToolBarStyle"
app:popupTheme="@style/ThemeOverlay.AppCompat"
app:layout_collapseMode="pin" />
Java file:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
/* Toolbar */
getSupportActionBar().setTitle("Nostrils");
toolbar.setTitleTextColor(0xFFFFFFFF);
// Back icon
getSupportActionBar().setDisplayHomeAsUpEnabled(true);
initNavigationDrawer();
}
Photo from the emulator:
https://i.stack.imgur.com/d3NNb.png