Radoslaw Juszczyk
._height_(IntrinsicSize._Max_)
Row
@Preview(widthDp = 370, backgroundColor = 0xFFFFFFFF) @Composable fun width370() { Test() } @Preview(widthDp = 375, backgroundColor = 0xFFFFFFFF) @Composable fun width375() { Test() } @Preview(widthDp = 380, backgroundColor = 0xFFFFFFFF) @Composable fun width380() { Test() } @Composable fun Test() { Surface { val items = (0..3).map { if (it % 2 == 1) { "Cateogry $it" } else { "Two lines Cateogry $it" } } Row( modifier = Modifier.padding(horizontal = 16.dp).fillMaxWidth() .height(IntrinsicSize.Max), horizontalArrangement = spacedBy(16.dp), ) { items.forEach { Column( modifier = Modifier.weight(1f).fillMaxHeight().border(2.dp, Color.Red), verticalArrangement = spacedBy(16.dp), ) { Box( modifier = Modifier .fillMaxWidth() .aspectRatio(1f), ) Text( text = it, textAlign = TextAlign.Center, overflow = TextOverflow.Ellipsis, softWrap = true, maxLines = 2, ) } } } } }
Zach Klippenstein (he/him) [MOD]
A modern programming language that makes developers happier.