Open zb666 opened 7 years ago
@Override public void onRefresh(final TwinklingRefreshLayout refreshLayout) { //super.onRefresh(refreshLayout); new Handler().postDelayed(new Runnable() { @Override public void run() { //这里可以请求网络 然后记得要先清空clear原先的集合 再加入数据 Toast.makeText(getApplicationContext(),"下拉刷新", Toast.LENGTH_SHORT).show(); refreshLayout.finishRefreshing(); //完成刷新 } },2000); }
finished,我设置了最大下拉高度,这样直接导致了没有触发下拉的边界,导致整个下拉回调无法正常走完
refreshlayout.setMaxHeadHeight(50); SinaRefreshView sinaRefreshView = new SinaRefreshView(this); sinaRefreshView.setArrowResource(R.drawable.ic_arrow); sinaRefreshView.setTextColor(0xff745D5C); refreshlayout.setHeaderView(sinaRefreshView);
@Override public void onRefresh(final TwinklingRefreshLayout refreshLayout) { //super.onRefresh(refreshLayout); new Handler().postDelayed(new Runnable() { @Override public void run() { //这里可以请求网络 然后记得要先清空clear原先的集合 再加入数据 Toast.makeText(getApplicationContext(),"下拉刷新", Toast.LENGTH_SHORT).show(); refreshLayout.finishRefreshing(); //完成刷新 } },2000); }