Ich habe ein Problem mit CollapsingToolbar
. Das Problem in diesem Fall muss ich kollabierte Symbolleiste haben, wenn Aktivität gerade erstellt wurde. Wenn ich das durch den Code mit appBarLayout.setExpanded(false, false)
in onCreate()
Methode mache, sehe ich erweiterte Symbolleiste zum ersten Mal und dann kollabierte es in einer Sekunde. Ich muss das entfernen und die komprimierte Symbolleiste sofort anzeigen.Einklappbare Symbolleiste ist standardmäßig minimiert
UPD:
<android.support.design.widget.AppBarLayout
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/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="200dp"
android:fitsSystemWindows="true">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
app:contentScrim="@color/colorPrimary"
app:expandedTitleMarginEnd="64dp"
app:expandedTitleMarginStart="16dp"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/toolbar_image_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:adjustViewBounds="true"
android:fitsSystemWindows="true"
tools:ignore="ContentDescription"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?actionBarSize"
android:background="@android:color/transparent"
app:layout_collapseMode="pin">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
Dieses kein Ergebnis hat ( – Near1999
Was, kollabiert Symbolleiste noch voll entfalteten passiert? –
Das in meinem Testprojekt arbeitet. Bitte Ihre gesamte Layout XML Post mit 'CoordinatorLayout' drin. –