Code: StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.HORIZONTAL); mRv.setLayoutManager(manager); mRv.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.HORIZONTAL_LIST), DividerItemDecoration.HORIZONTAL_LIST); mAdapter = new HomeAdapter(this, list); mRv.setAdapter(mAdapter);
Then recyclerview no adapter attached appears; skipping layout
And then check a variety of methods did not solve, a lot of online statements. But it still hasn’t solved the problem
StaggeredGridLayoutManager manager = new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.HORIZONTAL); mRv.setLayoutManager(manager); mAdapter = new HomeAdapter(this, list); mRv.setAdapter(mAdapter); mRv.addItemDecoration(new DividerItemDecoration(getActivity(), DividerItemDecoration.HORIZONTAL_LIST), DividerItemDecoration.HORIZONTAL_LIST);
I saw an example later. The code for finding the split line is called
after setAdapter.
Then try it, and it’s OK
Similar Posts:
- ValueError: day is out of range for month [How to Solve]
- ValueError: day is out of range for month [How to Solve]
- How to Solve Java Error: java.util.Arrays$ArrayList cannot be cast to java.util.ArrayList
- How to Solve Error: Cannot read property ‘map’ of undefined
- How to Solve Android Studio Error: SDK tools directory is missing
- builtin_function_or_method’ object is not subscriptable [How to Solve]
- Python scrapy/ ERROR: Spider must return request, item, or None, got ‘Tag ‘insettlement program
- Python:IndentationError: expected an indented block
- [Solved] Mybatis error: attempted to return null from a method with a primitive return type (int)
- Pycharm Error: ImportError: No module named model_selection