Wenn ich versuche, die Symbolleiste mit LinearLayout zu verwenden, wird die Statusleiste für Aktivitäten weiß, aber wenn ich das LinearLayout durch CoordinatorLayout ersetze, wird es ordnungsgemäß angezeigt.Android-Statusleiste wird weiß, wenn die Symbolleiste im linearen Layout verwendet wird
<android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</android.support.design.widget.CoordinatorLayout>
Dies ist mit Linear Layout
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:orientation="vertical">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:popupTheme="@style/AppTheme.PopupOverlay" />
</LinearLayout>
es auf diese Weise verwendet werden soll, soll, denn wenn ich es vor CoordinatorLayout früher verwendet, es funktioniert?
Unten finden Sie den Screenshot
Ich habe die Stile nicht richtig überprüft. Standardmäßig wurde die Farbe der Statusleiste auf transparent gesetzt. Vielen Dank – Bhushan