首页 > 移动平台 > 详细

Android ---------- 下拉刷新,上拉加载

时间:2018-11-03 11:07:14      阅读:127      评论:0      收藏:0      [点我收藏+]

视图布局部分:

<com.Widget.StateFrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
app:dataErrorLayoutResId="@layout/widget_dataerror"
app:emptyLayoutResId="@layout/widget_dataempty"
app:loadingLayoutResId="@layout/widget_data_loading"
app:needLoginLayoutResId="@layout/widget_needlogin"
app:netErrorLayoutResId="@layout/widget_neterror"
app:timeOutLayoutResId="@layout/widget_timeout"

>
<com.Widget.ASwipeRefreshLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
>
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="wrap_content" />
</com.Widget.ASwipeRefreshLayout>

</com.Widget.StateFrameLayout>

控制器部分:
// 设置上拉加载更多
swipelayoutyoudan.setOnLoadMoreListener(new ASwipeRefreshLayout.OnLoadMoreListener() {
@Override
public void onLoadMore() {
pageindex+=1;
requestData(false);
}
});
//设置下拉刷新
swipelayoutyoudan.setOnRefreshListener(new ASwipeRefreshLayout.OnRefreshListener() {
@Override
public void onRefresh() {
pageindex=1;
requestData(false);
}
});




Android ---------- 下拉刷新,上拉加载

原文:https://www.cnblogs.com/apeandcat/p/8390660.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!