Colton Idle
10/13/2021, 3:08 PMColton Idle
10/13/2021, 3:09 PMRow(modifier = Modifier.horizontalScroll(rememberScrollState())) {
Button(
onClick = { /*TODO*/ },
modifier = Modifier.fillMaxWidth().border(1.dp, Color.Green)
) { Text(text = "One") }
Button(
onClick = { /*TODO*/ },
modifier = Modifier.fillMaxWidth().border(1.dp, Color.Green)
) { Text(text = "Two\nTwo\nTwo") }
Button(
onClick = { /*TODO*/ },
modifier = Modifier.fillMaxWidth().border(1.dp, Color.Green)
) { Text(text = "Three") }
}
dimsuz
10/13/2021, 3:09 PMColton Idle
10/13/2021, 3:15 PMZach Klippenstein (he/him) [MOD]
10/13/2021, 3:33 PMfillMaxWidth
won’t work because making a row horizontally scrollable increases its max width constraint to infinity, which for most components mean they’ll just be their min width. You need to grab the width constraints that the row is seeing and manually pass those to your items (e.g. via a custom layout or BoxWithConstraints
).Colton Idle
10/13/2021, 3:34 PMraenardev
10/13/2021, 3:35 PMonMeasureConstrants
that Adam showed here:
https://kotlinlang.slack.com/archives/CJLTWPH7S/p1625934686417600
@Colton Idle take a look.raenardev
10/13/2021, 3:36 PMColton Idle
10/13/2021, 3:37 PMZach Klippenstein (he/him) [MOD]
10/13/2021, 3:42 PMColton Idle
10/13/2021, 3:46 PMraenardev
10/13/2021, 4:06 PMColton Idle
10/14/2021, 3:57 AM