Open xuehuashi opened 7 years ago
。。。。 recycleViewAdapter = new ArtRecycleViewAdapter(this); recycleView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); recycleView.addItemDecoration(new DividerItemDecoration(this)); recycleView.setAdapter(recycleViewAdapter); mPtrFrame.setPtrHandler(new PtrDefaultHandler() { @Override public void onRefreshBegin(PtrFrameLayout frame) { page=1; isRefresh=true; hasMore = true; loadData(page, mode, "0", deviceId, "0"); } }); mPtrFrame.setMode(PtrFrameLayout.Mode.REFRESH); //setmode()???? mPtrFrame.setOffsetToRefresh(200); mPtrFrame.autoRefresh(true); CustomPtrHeader header = new CustomPtrHeader(this,mode); mPtrFrame.setHeaderView(header); mPtrFrame.addPtrUIHandler(header); 。。。 setMode()方法在哪里调用,如何用
没有效果是什么意思? setMode是用来定义是否需要上拉或者下拉的。比如调用mPtrFrame.setMode(PtrFrameLayout.Mode.REFRESH);就无法上拉加载更多,只能下拉刷新
mPtrFrame.setMode(PtrFrameLayout.Mode.REFRESH);
。。。。 recycleViewAdapter = new ArtRecycleViewAdapter(this); recycleView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.VERTICAL, false)); recycleView.addItemDecoration(new DividerItemDecoration(this)); recycleView.setAdapter(recycleViewAdapter); mPtrFrame.setPtrHandler(new PtrDefaultHandler() { @Override public void onRefreshBegin(PtrFrameLayout frame) { page=1; isRefresh=true; hasMore = true; loadData(page, mode, "0", deviceId, "0"); } }); mPtrFrame.setMode(PtrFrameLayout.Mode.REFRESH); //setmode()???? mPtrFrame.setOffsetToRefresh(200); mPtrFrame.autoRefresh(true); CustomPtrHeader header = new CustomPtrHeader(this,mode); mPtrFrame.setHeaderView(header); mPtrFrame.addPtrUIHandler(header); 。。。 setMode()方法在哪里调用,如何用