How to use RecyclerView
inside NestedScrollView
?
RecyclerView
content is not visible after setting adapter.
UPDATE
If you are using RecyclerView-23.2.1
or later. Following solution will work just fine:
In your layout add RecyclerView like this:
And in your java file:
RecyclerView mRecyclerView = (RecyclerView) view.findViewById(R.id.recyclerView);
LinearLayoutManager layoutManager=new LinearLayoutManager(getContext());
layoutManager.setAutoMeasureEnabled(true);
mRecyclerView.setLayoutManager(layoutManager);
mRecyclerView.setHasFixedSize(true);
mRecyclerView.setAdapter(new YourListAdapter(getContext()));
Here layoutManager.setAutoMeasureEnabled(true);
will do the trick.
Check out this issue and this developer blog for more information.