Alex Styl
08/19/2024, 10:29 AMModifier.weight(1f)
but cap it's min width to a specific width (using Modifier.widthIn()
Doesn't seem to be working and the widthIn is ignored. I tried setting requiredWidthIn()
as well
Code in 🧵Alex Styl
08/19/2024, 10:29 AMRow(
Modifier
.fillMaxWidth()
.horizontalScroll(rememberScrollState())
) {
repeat(10) {
Box(
Modifier
.debugBorder(Color.Black)
.requiredWidthIn(48.dp)
.weight(1f)
.height(48.dp)
.background(randomColor())
)
}
}
Alex Styl
08/19/2024, 10:30 AMAlex Styl
08/19/2024, 10:31 AMAlex Styl
08/19/2024, 10:38 AMRow(Modifier.fillMaxWidth().horizontalScroll(rememberScrollState())) {
repeat(10) {
Box(
Modifier
.debugBorder(Color.Black)
.width(48.dp)
.height(48.dp)
.background(randomColor())
)
Box(Modifier.weight(1f))
}
}
Alex Styl
08/19/2024, 10:53 AMDan MacNeil
08/19/2024, 4:34 PM.requiredWidthIn
takes two parameters. They both have default value of Dp.Unspecified
. That may be throwing off your first code sample. .requiredWidth
is a single parameter version of the modifier.Alex Styl
08/19/2024, 4:36 PMrequiredWidthIn
intentionally. the first parameter is the min width you need, which is my case.
requiredWith()
sets the width to a fixed size, which I don't want to doJoseph Hawkes-Cates
08/19/2024, 7:37 PMdefaultMinSize(minWidth = ##.dp)
work? I think it shouldAlex Styl
08/19/2024, 7:40 PMJoseph Hawkes-Cates
08/19/2024, 7:44 PMAlex Styl
08/19/2024, 8:05 PM