Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Compose Row & Column Share Same LazyListState
val items: List<Room> = rooms
val listState = rememberLazyListState()
// Horizontal List
LazyRow(state = listState) {
items(items = items) { item -> RoomItem(item) }
}
// Vertical List
LazyColumn(state = listState) {
items(items = items) { item -> RoomItem(item) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment