Rafs
01/31/2024, 1:13 PMLazyColumn
as a child to a NestedScrollView
in an xml layout? There is already a RecyclerView there working which I want to replace with a compose LazyColumn
but i'm getting an IllegalStateException. Error message in 🧵Rafs
01/31/2024, 1:14 PMjava.lang.IllegalStateException: Vertically scrollable component was measured with an infinity maximum height constraints, which is disallowed. One of the common reasons is nesting layouts like LazyColumn and Column(Modifier.verticalScroll()). If you want to add a header before the list of items please add a header as a separate item() before the main items() inside the LazyColumn scope. There are could be other reasons for this to happen: your ComposeView was added into a LinearLayout with some weight, you applied Modifier.wrapContentSize(unbounded = true) or wrote a custom layout. Please try to remove the source of infinite constraints in the hierarchy above the scrolling container.
at androidx.compose.foundation.CheckScrollableContainerConstraintsKt.checkScrollableContainerConstraints-K40F9xA(CheckScrollableContainerConstraints.kt:35)
at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke-0kLqBqw(LazyList.kt:181)
stojan
01/31/2024, 1:17 PMNestedScrollView
.
having a RecyclerView
or LazyColumn
inside defeats the purpose of using them as all items will need to be layout and there will be no recycling.Joel Denke
01/31/2024, 1:19 PMAlbert Chang
01/31/2024, 2:21 PMModifier.nestedScroll(rememberNestedScrollInteropConnection())
to the LazyColumn.Joel Denke
01/31/2024, 2:23 PMAlbert Chang
01/31/2024, 2:29 PMAndroidView
.Rafs
01/31/2024, 2:53 PMNestedScrollView
, I'm only trying to add a few things to a legacy layout without changing it too much.Rafs
01/31/2024, 3:06 PMModifier.nestedScroll(rememberNestedScrollInteropConnection())
doesn't work either. It still crashes with the same error.Ian Lake
01/31/2024, 3:20 PMAlbert Chang
01/31/2024, 3:49 PM