如题
这是布局代码
`<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));
6条答案
按热度按时间e5njpo681#
嵌套滚动 demo 中有例子的,例子-潜逃滚动-整体嵌套,好好对比一下,你提供的代码也没看出什么问题
llycmphe2#
用在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.zhy.autolayout.AutoLinearLayout>
现在的问题就是底部控件不显示,无法加载更多。
xienkqul3#
同样问题。
px9o7tmv4#
我也是SmartRefreshLayout嵌套CoordinatorLayout不能实现加载更多 @liuxuesong001@wjk2813 请问解决了吗
clj7thdc5#
我是SmartRefreshLayout嵌套CoordinatorLayout, CoordinatorLayout最下面放的recyclerview
ha5z0ras6#
问题加一