Android   发布时间:2022-04-28  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了android:折叠工具栏在向上滚动时反弹大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我有以下布局
<android.support.design.widget.CoordinatorLayout
    android:id="@+id/rootLayout"
    xmlns:android="http://scheR_317_11845@as.android.com/apk/res/android"
    xmlns:app="http://scheR_317_11845@as.android.com/apk/res-auto"
    xmlns:cardview="http://scheR_317_11845@as.android.com/apk/res-auto"
    android:BACkground="@color/white"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <android.support.design.widget.AppBarLayout
        android:fitsSystemWindows="true"
        android:layout_width="match_parent"
        android:layout_height="250dp">

         <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/collapsing_toolbar"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:minHeight="?attr/actionBarSize"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            android:fitsSystemWindows="true">

                <RelativeLayout 
                    xmlns:android="http://scheR_317_11845@as.android.com/apk/res/android"
                    android:id="@+id/layout_toolbar"
                    android:layout_width="fill_parent"
                    android:orientation="vertical"
                    app:layout_collapseMode="parallax" 
                    android:layout_height="match_parent">

                        <com.android.volley.toolBox.VolleyImageView 
                            android:id="@+id/image_toolbar"
                            android:layout_width="fill_parent"
                            android:layout_height="match_parent"
                            android:scaleType="centerCrop"/>

                        .... some text views aligned over image...
                </RelativeLayout>

                <android.support.v7.widget.Toolbar
                    android:id="@+id/tool_bar"
                    android:layout_width="match_parent"
                    android:layout_height="?attr/actionBarSize"
                    app:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar"
                    app:popupTheme="@style/ThemeOverlay.AppCompat.Light" />


        </android.support.design.widget.CollapsingToolbarLayout>
    </android.support.design.widget.AppBarLayout>

        <android.support.v7.widget.RecyclerView
        android:id="@+id/lisT_Brands"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:layouT_Behavior="@String/appbar_scrolling_view_behavior"/>
</android.support.design.widget.CoordinatorLayout>

当我在回收站视图中快速向上滚动时,折叠的工具栏无法顺利打开,但会跳出并关闭.我不知道什么是错的.我正在关注this文章.

任何帮助将受到高度赞赏.

解决方法

编辑:更新到v23设计和v23 recyclerview似乎修复了弹跳效果.您需要将compileSdkVersion更改为23,并将buildToolsVersion更改为“23.0.0”.
请注意,如果您尝试从标题滚动,则v23会有其他错误,例如崩溃
at android.support.design.widget.CoordinatorLayout.onTouchEvent(CoordinatorLayout.java:449)

这个新bug的不同解决方在这里https://code.google.com/p/android/issues/detail?id=183166

这是谷歌跟踪的一个错误,他们说它应该在com.android.support.design v23中修复

https://code.google.com/p/android/issues/detail?id=175243

大佬总结

以上是大佬教程为你收集整理的android:折叠工具栏在向上滚动时反弹全部内容,希望文章能够帮你解决android:折叠工具栏在向上滚动时反弹所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。