Ich verwende eine CoordinatorLayout und diese (app:layout_scrollFlags="scroll|enterAlways"
) Codezeile, um die Symbolleiste auszublenden, wenn eine RecyclerView gescrollt wird. Und das funktioniert auch ziemlich gut, aber die Toolbar wird nicht hinter der Statusleiste versteckt, weil sie transparent ist.So machen Sie die Statusleiste nicht transparent (Android 5)
Mein Layout sieht aus wie diese
<?xml version="1.0" encoding="utf-8"?>
<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:id="@+id/main_content"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
tools:context="com.yannisbecker.backup.MainActivity">
<android.support.design.widget.AppBarLayout
android:id="@+id/appbar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:paddingTop="@dimen/appbar_padding_top"
android:theme="@style/AppTheme.AppBarOverlay">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:background="?attr/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways" />
<android.support.design.widget.TabLayout
android:id="@+id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
<android.support.design.widget.FloatingActionButton
android:id="@+id/fab"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center|bottom"
android:layout_margin="@dimen/fab_margin"
android:src="@drawable/ic_backup_white_24dp"/>
</android.support.design.widget.CoordinatorLayout>
Da ich schon im Internet gesucht und gefunden nur eine Menge Dinge über „Wie man die Statusbar transparent“ Ich frage jetzt hier und jemand hoffen kann helfen mich.
Weil ich habe nicht genug Ruf, noch können Sie Sie ein Bild mit der zeigt mein Problem here
Sie müssen den XML-Layoutcode posten. –
Ich habe das Layout jetzt hinzugefügt – Steve2955