I'm beginner in Android Development and trying to create a display of items in such a way that the size of these varieties according to the quantity, as they have done in this app. Any suggestions?
Asked
Active
Viewed 120 times
2 Answers
0
So according to your question you have to add weight to the child elements which you can be given from parent layout like ex: recyclerview weight 3, and its item weight 1 each(if you have 3 items and fit in the width with margins on either sides) and consider to assign 3 to 6 elements in the width of the screen with horizontal scrolling
mRecyclerView.setLayoutManager(new LinearLayoutManager(this, LinearLayoutManager.HORIZONTAL, true));
check here how to set weights for the views How to set layout_weight attribute dynamically from code?

Prakash Reddy
- 944
- 10
- 20