如何从滚动停止嵌套滚动视图直到折叠工具栏布局完成滚动?

时间:2016-05-24 19:51:02

标签: android view scroll nested

我有一个嵌套滚动视图和一个折叠工具栏布局。现在,嵌套滚动视图与折叠工具栏布局一起滚动。我希望嵌套滚动视图在滚动完成折叠工具栏布局后滚动。有什么想法吗?

<android.support.design.widget.CoordinatorLayout
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"
tools:context=".activitys.Activity">

<android.support.design.widget.AppBarLayout
    android:id="@+id/appBarLayout"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:layoutDirection="rtl"
    android:theme="@style/AppTheme.AppBarOverlay">

    <android.support.design.widget.CollapsingToolbarLayout
        android:id="@+id/collapsingToolbarLayout"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layoutDirection="rtl"
        app:contentScrim="@color/colorPrimary"
        app:layout_scrollFlags="scroll|exitUntilCollapsed"
        app:popupTheme="@style/AppTheme.PopupOverlay">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:id="@+id/blurImage"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:clickable="false"
                android:scaleType="centerCrop"
                app:layout_collapseMode="parallax"/>

            <de.hdodenhof.circleimageview.CircleImageView
                android:id="@+id/image"
                android:layout_width="150dp"
                android:layout_height="150dp"
                android:layout_centerInParent="true"/>

        </RelativeLayout>

        <android.support.v7.widget.Toolbar
            android:id="@+id/toolbar"
            android:layout_width="match_parent"
            android:layout_height="?attr/actionBarSize"
            android:minHeight="?attr/actionBarSize"
            android:background="@android:color/transparent"
            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:layout_width="match_parent"
    android:layout_height="match_parent"
    android:fillViewport="true"
    app:layout_behavior="@string/appbar_scrolling_view_behavior">


    //SOME OTHER LAYOUTS


</android.support.v4.widget.NestedScrollView>

0 个答案:

没有答案