0

I have a recyclerview and I would like to change its item/child's width dynamically instead of changing the xml file which contains the layout for the item/child. I have tried doing the following from other answers but it changes the whole recyclerview's width instead of it's child/item.

ViewGroup.LayoutParams layoutParams= recyclerview.getLayoutParams();
layoutParams.widht = 200;
recyclerview.setLayoutParams(layoutParams);
craftdeer
  • 875
  • 4
  • 18
  • 34
  • this may help https://stackoverflow.com/questions/42808433/recyclerview-item-height-and-width-change-dynamically-android – Gitesh Oct 13 '21 at 17:15

0 Answers0