Ich habe eine NestedScrollView
mit CollapsingToolbarLayout
und ich möchte es reibungslos funktionieren lassen.Collapsing Symbolleisten-Layout mit NestedScrollView scrollt nicht glatt
Mein Problem ist, wenn ich vom Inhalt nach oben scrolle, wird meine Collapsing Toolbar nicht automatisch erweitert, sondern blockiert, wenn sie oben ankommt. Dann muss ich noch einmal nach oben scrollen, um die Symbolleiste zu erweitern.
Ich mag würde smooth scrolling up von Inhalten erreichen, die Auto erweitern würde mein CollapsingToolbarLayout
Hier ist mein Code:
<?xml version="1.0" encoding="utf-8"?>
<android.support.design.widget.CoordinatorLayout
android:id="@+id/product_detail_main_content"
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:apptools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent">
<android.support.design.widget.AppBarLayout
android:id="@+id/app_bar_layout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">
<android.support.design.widget.CollapsingToolbarLayout
android:id="@+id/collapsing_toolbar"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clipToPadding="true"
android:foregroundGravity="bottom|right"
android:foregroundTintMode="add"
app:contentScrim="?attr/colorPrimary"
app:layout_scrollFlags="scroll|exitUntilCollapsed">
<ImageView
android:id="@+id/image"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fitsSystemWindows="true"
android:scaleType="centerCrop"
app:layout_collapseMode="parallax"
app:layout_collapseParallaxMultiplier="0.7"/>
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
android:fitsSystemWindows="true"
app:layout_collapseMode="pin"
app:popupTheme="@style/ThemeOverlay.AppCompat.Light"
app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"/>
</android.support.design.widget.CollapsingToolbarLayout>
</android.support.design.widget.AppBarLayout>
<android.support.v4.widget.NestedScrollView
android:id="@+id/scroll"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
/*
CONTENT
*/
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
ich einige ähnliche Fragen gefunden, aber keine der Antworten für mich gearbeitet.
Versuchen zu einstellen 'android: fitsSystemWindows = "true"' in 'CoordinatorLayout'. –
Nein, hat nicht funktioniert. – Meemaw
eine Lösung gefunden? – apk