Join Slack
Powered by
In compose, can we get width dynamically? For exam...
# compose
a
Ankit Shah
12/10/2021, 12:00 PM
In compose, can we get width dynamically? For example I do have a Row with fillMaxWidth and in the elements I have two Box inside row to which I want to provide 50%-50% width of parent Row. If yes, how can I achieve it?
j
jannis
12/10/2021, 12:02 PM
Use the `.weight()`modifier on the children. Or
.fillMaxWidth(fraction)
👍 1
a
Ankit Shah
12/10/2021, 12:04 PM
great thanks a lot
@jannis
, it worked.
👌 1
c
Chris Sinco [G]
12/10/2021, 5:13 PM
Be sure to check out our Layout guides:
https://developer.android.com/jetpack/compose/layouts/
We cover many things here
49
Views
Open in Slack
Previous
Next