Lukasz Burcon
02/07/2022, 9:16 PMModifier.requiredSize(50.dp)
to MyTestComposable
, and I expected that I would override the size with the new value - 50.dp
. And yeah, the size is being modified, but somehow when I try to use MyTestComposable
in a Column it looks like another view is being drawn on top of MyTestComposable
- take a look at the picture attached in thread.
@Composable
private fun MyTestComposable(
modifier: Modifier = Modifier,
) {
Box(
modifier = Modifier
.border(1.dp, Color.Blue)
.requiredSize(25.dp)
.then(modifier) ,
)
}
Column {
MyTestComposable(
modifier = Modifier
.requiredSize(50.dp)
.border(1.dp, Color.Red),
)
Text(text = "Test text")
}
mattinger
02/07/2022, 10:13 PM.requiredSize(50.dp).border(1.dp, Color.red)
then it's applying the second one:
.requiredSize(25.dp).border(1.dp, Color.Blue)
Column(modifier=
Modifier.background(Color.Blue)
.padding(10.dp)
.background(Color.Red)
)
Lukasz Burcon
02/08/2022, 7:40 AM