I have layout which includes some button, textviews and a recyclerview.
The layout already has a scrollView, so i disabled scroll
of recyclerView
.
Now i want to set the height of recyclerView programatically.
This is what i am doing right now.
int totalItems= cardsRecyclerAdapter.getItemCount();
ViewGroup.LayoutParams params=rvCards.getLayoutParams();
params.height=200*totalItems;
rvCards.setLayoutParams(params);
Here i am hardcoding 200
for testing, and its working fine, but i am using wrap_content
for image height, and image height can be of any length, so i want to calculate the height the right way.
Is there any way to get the actual height of recycler view?