Ayfri
09/05/2021, 4:04 PMRow
, how can I set a required width for the second element, but have the first element just have a minimum size but take the maximum size available without overlapping the second element ?Ayfri
09/05/2021, 4:05 PMModifier.fillMaxWidth()
and the second Modifier.requiredWidth(150.dp)
but they are overlappingJan Skrasek
09/05/2021, 4:18 PMAyfri
09/05/2021, 4:19 PMFudge
09/05/2021, 9:32 PMFudge
09/05/2021, 9:37 PMAyfri
09/05/2021, 9:41 PMException in thread "AWT-EventQueue-0" 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.
But I'm not exactly sure how to fix itTobias Suchalla
09/06/2021, 5:55 AMRow {
Thing1(Modifier.weight(1f))
Thing2(Modifier.width(150.dp)
}
This should make Thing2 exactly 150.dp wide and have Thing1 take up all the remaining space.
weight(Float)
determines how the unused space is divided up between participating composables. If only one composable specifies it, it gets all the available unused space. Otherwise, the composables divide the space according to their weight (1f/1f -> 50%/50%
, 1f/2f -> 33.3%/66.6%
, 2f/2f -> 50%/50%
, 1f/2f/3f -> 16.6%, 33.3%, 50%
, you get the idea).Ayfri
09/06/2021, 8:39 AMweight
method, intellij don't want to import it, where it is located ?Ayfri
09/06/2021, 8:40 AMAyfri
09/06/2021, 8:42 AM