Hello everyone, is there a way to set a height or ...
# compose
k
Hello everyone, is there a way to set a height or padding to take up a size, unless there's not enough space? Like be
40.dp
high, unless that would cut off something underneath it, then take less
a
It depends what you are trying to achieve.
Modifier.size()
sort of does it by default - ive noticed that it squeezes the component if there is not enough space.
Modifier.requireSize()
is the one that is strict about the sizing, so it might be enough setting it to the more important component. Otherwise you could use
weight()
inside a col/row
k
is there a way to tell compose to scale one composable over another? Like if a spacer above a button has a size and the button has a size too, can you tell compose to scale the spacer first? I guess that's where
requireSize
comes in
a
> is there a way to tell compose to scale one composable over another? not that i am aware of. tbh it would be simpler to help you achieve what you want if you explained the layout you are trying to build. i dont understand what scaling a spacer does or why you would need that