I am doing an app and the status bar is now white. I'm not doing anything fancy with the layout. How can I get the status bar to show as "normal" (which would be dark with white icons). .
Here is my layout:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android:id="@+id/container_toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
xmlns:android="http://schemas.android.com/apk/res/android">
<include
android:id="@+id/toolbar"
layout="@layout/toolbar" />
<include layout="@layout/content_movie_detail" />
</LinearLayout>
Toolbar:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:local="http://schemas.android.com/apk/res-auto"
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:minHeight="?attr/actionBarSize"
android:background="@color/colorPrimary"
local:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
local:popupTheme="@style/ThemeOverlay.AppCompat.Light" />
Activity:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_movie_detail);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
actionBar = getSupportActionBar();
try {
assert actionBar != null;
actionBar.setDisplayHomeAsUpEnabled(true);
actionBar.setHomeButtonEnabled(true);
actionBar.setDisplayShowTitleEnabled(true);
} catch (Exception ignored) {
Log.e(TAG,ignored.toString());
}
}
What am I missing?
I found the answer here:
Status bar is white
<item name="android:statusBarColor">@android:color/transparent</item>
You'll see that line of code in values/styles/styles.xml(v21) . Remove it and that solves the issue
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With