Is it possible to limit a `LazyVerticalGrid` to sp...
# compose
y
Is it possible to limit a
LazyVerticalGrid
to specific number of rows or do I have to manually calculate how many items I need to pass to it in order to make it stay on the number of rows I want to show?
I have 100+ items and want to show as many as can be fitted on 2 rows. I can make the grid choose the proper number of items for each row depending on the size of screen and item but i cannot find a way to limit it to a specific number of rows.
z
I could be wrong but I think you're looking for StaggeredGrid? You could set a row count of 2
https://developer.android.com/codelabs/jetpack-compose-layouts#7 I do not know if the views are recycled properly
y
I am not really trying to do a StaggeredGrid. I think I probably have not explained properly.
I have a large list of 100 items. but only want to show 2 rows of them on my screen. I want the number of items on each row be based on the screen size. I know I can manually check how many items I should show based on the screen size etc. but i was wondering if I can do that without my own custom code for it.
I can basically just make a 10 item list out of the large list. I just wanted to avoid making my own custom code to calculate how many items should be shown for that amount of space.