List<Cheese> results = new ArrayList<Cheese>();
results.add(new Cheese("", "my titles develop by random1"));
results.add(new Cheese("", "my titles develop by random2"));
results.add(new Cheese("", "my titles develop by random3"));
results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random4"));
results.add(new Cheese("", "my titles develop by random5"));
results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random6"));
results.add(new Cheese("", "my titles develop by random7"));
results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random8"));
results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random9"));
results.add(new Cheese("", "my titles develop by random10"));
results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random11"));
results.add(new Cheese("", "my titles develop by moremoremoremoremoremoremoremore random12"));
results.add(new Cheese("", "my titles develop by random13"));
results.add(new Cheese("", "my titles develop by random14"));
results.add(new Cheese("", "my titles develop by random15"));
recyclerView.setAdapter(adapter = new OneRecycleAdapter(getActivity()));// 这句可以赋值adapter
}
您好,您的demo很好,但是我想请问您这个代码是在那里给recycleview赋的值呐? 以OneRecycleFragment为例子 private void initBase() { // lay_fresh = (SwipeRefreshLayout) this.rootView.findViewById(R.id.lay_refresh); // lay_fresh.setColorSchemeResources(R.color.colorPrimary, R.color.colorPrimaryDark); // lay_fresh.setOnRefreshListener(this);
// recyclerView.setLayoutManager(new LinearLayoutManager(recyclerView.getContext(), LinearLayoutManager.VERTICAL, false)); recyclerView.setLayoutManager(new GridLayoutManager(recyclerView.getContext(), 6, GridLayoutManager.VERTICAL, false)); // recyclerView.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
List的数据,我没有看到对应的赋值,
请问最后的赋值是在哪里,那个文件,谢谢您啦