Vaibhav Jaiswal
05/18/2024, 7:11 AMSurface(
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
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 fineVaibhav Jaiswal
05/18/2024, 7:14 AMAndroidDev Homepage
05/18/2024, 11:20 AMColumn1(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 againVaibhav Jaiswal
05/18/2024, 12:14 PMAndroidDev Homepage
05/27/2024, 7:20 AM