giorgos
04/03/2025, 8:35 AM@Composable
fun BarcodeListItem(
description: String,
modifier: Modifier = Modifier,
) {
Row(
modifier = modifier,
) {
Image(
painter = painterResource(R.drawable.barcode),
contentDescription = null,
contentScale = ContentScale.Crop,
)
Text(
text = description,
)
}
}
Is there a way, without using OnGloballyPositioned modifier, to tell the Row to always take the height of its Text child composable?giorgos
04/03/2025, 3:19 PM.height(IntrinsicSize.Max)
is the trick:
@Composable
fun BarcodeListItem(
description: String,
modifier: Modifier = Modifier.height(IntrinsicSize.Max),
) {
Row(
modifier = modifier,
) {
Image(
painter = painterResource(R.drawable.barcode),
contentDescription = null,
contentScale = ContentScale.Crop,
)
Text(
text = description,
)
}
}