SmartRefreshLayout icon indicating copy to clipboard operation
SmartRefreshLayout copied to clipboard

用在CoordinatorLayout外部的时候 为什么不能加载更多了

Open s2405330 opened this issue 7 years ago • 7 comments

如题

这是布局代码 `<com.scwang.smartrefresh.layout.SmartRefreshLayout 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/refreshLayout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitsSystemWindows="true" app:srlAccentColor="@android:color/white" app:srlPrimaryColor="@android:color/holo_green_light">

<android.support.design.widget.CoordinatorLayout
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context="com.scwang.refreshlayout.activity.using.MyCustomActivity">

    <android.support.design.widget.AppBarLayout
        android:id="@+id/app_bar"
        android:layout_width="match_parent"
        android:layout_height="@dimen/app_bar_height"
        android:fitsSystemWindows="true"
        android:theme="@style/AppTheme.AppBarOverlay">

        <android.support.design.widget.CollapsingToolbarLayout
            android:id="@+id/toolbar_layout"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:fitsSystemWindows="true"
            app:contentScrim="?attr/colorPrimary"
            app:layout_scrollFlags="scroll|exitUntilCollapsed"
            app:toolbarId="@+id/toolbar">

            <android.support.v7.widget.Toolbar
                android:id="@+id/toolbar"
                android:layout_width="match_parent"
                android:layout_height="?attr/actionBarSize"
                app:layout_collapseMode="pin"
                app:popupTheme="@style/AppTheme.PopupOverlay"/>

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

    <include layout="@layout/content_my_custom"/>//这里面是个scrollview

    <android.support.design.widget.FloatingActionButton
        android:id="@+id/fab"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_margin="@dimen/fab_margin"
        app:layout_anchor="@id/app_bar"
        app:layout_anchorGravity="bottom|end"
        app:srcCompat="@android:drawable/ic_dialog_email"/>

</android.support.design.widget.CoordinatorLayout>

</com.scwang.smartrefresh.layout.SmartRefreshLayout>`

activity中的代码是这样的 mRefreshLayout = (RefreshLayout) findViewById(refreshLayout); mRefreshLayout.setOnRefreshLoadMoreListener(this); mRefreshLayout.setRefreshHeader(new ClassicsHeader(this)); mRefreshLayout.setRefreshFooter(new ClassicsFooter(this));

s2405330 avatar Mar 15 '18 02:03 s2405330

嵌套滚动 demo 中有例子的,例子-潜逃滚动-整体嵌套,好好对比一下,你提供的代码也没看出什么问题

scwang90 avatar Mar 15 '18 11:03 scwang90

用在CoordinatorLayout外部的时候 为什么不能加载更多了: NestedViewPager 嵌套 ("ViewPager", NestedScrollExampleFragmentViewPager.class); Demo 里边是用adaprer 实现了上拉 操作。 请看我的问题布局代码,我想实现,在在外层实现下拉刷新,然后,根据viewpager 里边的数据自动加载更多。

<com.zhy.autolayout.AutoLinearLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical">

<com.scwang.smartrefresh.layout.SmartRefreshLayout
    android:id="@+id/swipe_container"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@android:color/white"
    app:layout_behavior="@string/appbar_scrolling_view_behavior"
    app:srlEnableAutoLoadMore="false"
    app:srlEnableFooterTranslationContent="true">

    <com.scwang.smartrefresh.header.MaterialHeader
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    </com.scwang.smartrefresh.header.MaterialHeader>


    <android.support.design.widget.CoordinatorLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent">


        <android.support.design.widget.AppBarLayout
            android:id="@+id/appBarLayout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:theme="@style/ThemeOverlay.AppCompat.Dark.ActionBar">

            <android.support.design.widget.CollapsingToolbarLayout
                android:id="@+id/collapse_toolbar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:background="@android:color/transparent"
                app:contentScrim="@android:color/transparent"
                app:layout_scrollFlags="scroll|exitUntilCollapsed">


                <include layout="@layout/include_sm_header" />

                <include layout="@layout/include_title_sm" />


                <com.rainxing.shzzzfd.mvp.weiget.tablayout.TabLayout
                    android:id="@+id/tab_layout"
                    android:layout_width="match_parent"
                    android:layout_height="40dp"
                    android:layout_gravity="bottom|center"
                    android:background="@android:color/white"
                    android:gravity="center"
                    app:tabGravity="center"
                    app:tabIndicatorColor="@color/color_2A67FF"
                    app:tabIndicatorHeight="3dp"
                    app:tabMode="fixed"
                    app:tabSelectedTextColor="@android:color/black"
                    app:tabTextAppearance="@style/tab_appearance_sm"
                    app:tabTextColor="@color/color_333333" />


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

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


        <android.support.v4.view.ViewPager
            android:id="@+id/view_pager"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:layout_behavior="@string/appbar_scrolling_view_behavior" />


    </android.support.design.widget.CoordinatorLayout>


    <com.scwang.smartrefresh.header.MaterialHeader
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    </com.scwang.smartrefresh.header.MaterialHeader>

</com.scwang.smartrefresh.layout.SmartRefreshLayout>

</com.zhy.autolayout.AutoLinearLayout>

现在的问题就是底部控件不显示,无法加载更多。

liuxuesong001 avatar Mar 15 '19 10:03 liuxuesong001

同样问题。

wjk2813 avatar Oct 10 '19 01:10 wjk2813

我也是SmartRefreshLayout嵌套CoordinatorLayout不能实现加载更多 @liuxuesong001 @wjk2813 请问解决了吗

zhupengxiang avatar Mar 10 '20 03:03 zhupengxiang

我是SmartRefreshLayout嵌套CoordinatorLayout, CoordinatorLayout最下面放的recyclerview

zhupengxiang avatar Mar 10 '20 04:03 zhupengxiang

问题加一

kyriej avatar Mar 03 '21 07:03 kyriej

同样问题,SmartRefreshLayout嵌套CoordinatorLayout, CoordinatorLayout最下面放的一个FrameLayout,用来动态替换成Fragment显示列表,不能加载更多,应该是嵌套的问题,你们有解决的吗

xuzhu19930323 avatar Jun 14 '23 06:06 xuzhu19930323