Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The status bar is white above toolbar [duplicate]

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). screen shot.

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?

like image 523
Kristy Welsh Avatar asked Nov 29 '22 08:11

Kristy Welsh


1 Answers

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

like image 69
Kristy Welsh Avatar answered Dec 09 '22 23:12

Kristy Welsh