I have a Lazy Column, in which The item composable...
# compose
v
I have a Lazy Column, in which The item composable is something like this
Copy code
Surface(
    modifier = modifier.then(clickModifier),
    color = Color.Transparent
) {
    Row(
        modifier = Modifier.fillMaxWidth()
            .height(IntrinsicSize.Max)
            .padding(contentPadding),
        horizontalArrangement = Arrangement.spacedBy(8.dp)
    ) {
        Column1(modifier = Modifier.fillMazHeight())
        Column(modifier = Modifier.weight(!f){
             Text()
             WebView(modifier = Modifier.height(200.dp)
        }
    }
}
Now my app is crashing with this error
Copy code
java.lang.IllegalStateException: Asking for intrinsic measurements of SubcomposeLayout layouts is not supported. This includes components that are built on top of SubcomposeLayout, such as lazy lists, BoxWithConstraints, TabRow, etc. To mitigate this:
                                                                                                    - if intrinsic measurements are used to achieve 'match parent' sizing, consider replacing the parent of the component with a custom layout which controls the order in which children are measured, making intrinsic measurement not needed
                                                                                                    - adding a size modifier to the component, in order to fast return the queried intrinsic measurement.
If I remove the
height(IntrinsicSize.Max)
from the Row, it works fine
I tried wrapping webview inside a Box and Surface But it still crashed
a
The issue might be from the
Column1(modifier = Modifier.fillMazHeight())
because you are giving the entire height of the screen to this child composable node. And you are also using
.height(IntrinsicSize.Max)
on the Row layout, therefore the entire height of the Row will be the maximum height of the child nodes of the Row layout, which might take too long to query from the subcomposeLayout implementations like LazyColumn. So try and give a fixed height to the
Column1(modifier = Modifier.fillMazHeight())
to see if it crashes again
v
It will definitely fix it, but thats not what i want I want Column1 to match the height of Column2
a
I see you are giving a fixed height if 200 dp to the column2. In the case where you want the column1 to have the same height as column2 then use 200 dp as a height to the column1 also
470 Views